Regular expression help for segregate special character

Hi all, I am newbie Uipath, I have a data table with following value and I need to take only the value prior to the “_” special character,

Ex-
1988411_YM2021-189
1988399_NY2021-1120
1988397_YK2021-312

Output need to be
1988411
1988399
1988397

Thanks in advance

Use the regex
.*(?=_) or use ^\d+


Regards
Chethan P

1 Like

grafik

Or use split or Substring Also
VariableB=VariableA.substring(0,variable.index("_")

Note VariableA is your text

Please Mark it as Solution

Regards
Chethan P

Hi @Duleepa_Krishan

you can try this regex pattern [ more precise it seems]

image

Regards,
Nived N

1 Like

Thanks Its worked like a charm

1 Like

You are welcome What @ppr And @NIVED_NAMBIAR They also right you can follow there code

1 Like

Thanks

Thanks!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.