I need to extract the bold text out of the lines below and am having trouble due to the difference in format with where the "TSF" is placed before or after the "-". The Current expressions I am using are below and is working for the first example, but the second example has a different format. The third example I have below i have a different expression that works but was wondering if there is a expression that works for all 3. I need to pull this information out to eventually turn them into full dates.
Example 1: FX[A-Z]\s.*\s(\d.*)\sTSF
FXZ January 1_20 TSF - ABC Labor-ABC-539239
Current Output "1_20" Correct
Example 2: FX[A-Z]\s.*\s(\d.*)\sTSF
FXT January 2_03 - TSF ABC Labor-ABC-536013
Current Output "2_03 - " Incorrect
Example 3: FX[A-Z]\s(.*)\sTSF*
FXA September 2022 TSF - ABC Labor ABC-530325 ABC-530326
Appreciate any help I can get!
Hi, @bburzanko3
Maybe you can do this way by RegEx expression:
([[:alpha:]]{3,}\s\d{4}|\d{1,2}_\d+)(?=[\-\s]+?TSF)
***
By the way,
January 1_20 = 2020-01-01 ?
January 2_03 = 2003-01-02 ?
September 2022 = 2022-09-01 ?