Skip to main content
Solved

Extracting text from an inconsistent string of text

  • July 10, 2023
  • 2 replies
  • 40 views

Forum|alt.badge.img+5

Hello! I am currently trying to extract information from an inconsistent string of text and having a tough time.

Ideally, I would be able to drop the MONTH and DATE from the String of text and KEEP the all the text along with just theYEAR. 

The trouble is, both the intro text (represented as X's) and the dates are not consistent lengths. 

EXAMPLES OF TEXT:  DESIRED OUTPUT: 

XXXXX.RTW.Men.7.5.2023

XXXXX.RTW.Men.2023

XXX.RTW.Women.12.10.2022

XXX.RTW.Women.2022

XXXX.RTW.11.6.2022

XXXX.RTW.2022

Is there a formula that can do this? I am not great at these types of formulas (and I feel like this is potentially very simple!) - hoping someone can help! 

Let me know if I can provide further info to provide a solution. Thank you in advance for your help! 

Best answer by Sho

Hello @Sara_Ophoff ,

For Regex, it's like this.

REGEX_REPLACE({Text},".\\d+.\\d+.",".")

 

2 replies

Forum|alt.badge.img+21
  • Inspiring
  • Answer
  • July 11, 2023

Hello @Sara_Ophoff ,

For Regex, it's like this.

REGEX_REPLACE({Text},".\\d+.\\d+.",".")

 


Forum|alt.badge.img+5
  • Author
  • Known Participant
  • July 11, 2023

Hello @Sara_Ophoff ,

For Regex, it's like this.

REGEX_REPLACE({Text},".\\d+.\\d+.",".")

 


@Sho thank you!!!! This worked perfectly!!