Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Extracting two digits after an specific character with Regex

VahidGoli
8 - Asteroid

Hi All,

I have these strings:
RIG09_ Tghkj_C_2:1
SdTG_RIG09_bBRF_C_2:1

 

I want a formula to generate Rig 09 for both strings.

 

 

So actually I want to get two digits after the word RIG in any string and just Rig+two digits.

 

Would you please help me out?

 

Kind regards,

2 REPLIES 2
Sebastiaandb
12 - Quasar

Hi @VahidGoli ,

 

 

This might be it :-):

 

(.*)(RIG)(\d{2})(.*)

 

and then take group 3.

 

Sebastiaandb_0-1662099474373.png

 

 

Greetings,

 

Seb

DataNath
17 - Castor

RegEx tool > Parse mode, with the following expression:

 

(RIG\d{2})

 

No need for the additional groups if you’re only interested in this part.

Labels