How to extract a specific word from a string using REGEX in uipath?

From the following string pattern i want to take the value starting only from :21:

:20AD2793802:48
:21:34SFYE88038874098
:61:39KSHDLS//K32947190LKDJ
:6937:SALJ7391084:470319HFD
:12:321534/KJHDKA9873024

Hi @Tamil_Ilakkiya

Welcome to the UiPath Community.

This link will be useful for you

Also please write the output string required

So out of 4 lines, you wanted only line 2? What is your expected output if matched?? Something like this…??

image

1 Like

@prasath17 Actually i need a entire line alone which is starting from :21. Like you have highlighted.

Then, please try the pattern as shown above…it should work unless you have some different variations…

@prasath17 It is not selecting the whole line. Please find below.

@Tamil_Ilakkiya

Try to run it as it is and check the output. Sometimes the builder doesn’t show the correct match.

@kumar.varun2 The same way i just wanted to take only :61: lines. But it is selecting extra chars from next line as well. How to resolve this?

Try with

:61:.+

@kumar.varun2 Tried running, but it says that the input value is Null, but there is a value which i have handled before this activity.

@Tamil_Ilakkiya

Check for the input given to Matches activity.

It is working now. Thank you guys. :slight_smile: @kumar.varun2 @prasath17