REGX - How to get the particular text in the String using Regx?

Hi UiPath forum,

Can you please help me getting particular text in the input string

Input :
Here is the Reference no : A1425A85A
Here is the Reference no : A17825A8A

Output:
A1425A85A

1 Like

Hi @K_GOWTHAM

Welcome to UiPath Community

Try with this Regular Expression

System.Text.RegularExpressions.Regex.Match(YourString,"(?<=Reference\sno\s\W\s)\S+").Tostring

image

Regards
Gokul

2 Likes

image

Hi @K_GOWTHAM

/(?<=Reference no :).*

Hope it helps!!

1 Like

Hi @K_GOWTHAM

Welcome to Community!!

Input="Here is the Reference no : A1425A85A
Here is the Reference no : A17825A8A"

Match=System.Text.RegularExpressions.Regex.Match(Input.ToString,"(?<=Reference no\s+:\s+).*").Value

Hope this helps!!

@K_GOWTHAM ,
Kindy find the regex pattern, it will help you

System.Text.RegularExpressions.Regex.Match(YourString,"(?<=Reference\sno\s:\s)[A-Za-z\d]+").Tostring

image

1 Like

@K_GOWTHAM

System.Text.RegularExpressions.Regex.Match(str,“(?<=Reference no :\s).*”).Value

image

Hi @K_GOWTHAM

Use the below regular expressions to get the required output.

- Assign -> Input = "Here is the Reference no : A1425A85A
                     Here is the Reference no : A17825A8A"
- Assign -> output = System.Text.RegularExpressions.Regex.Match(yourstringinput.ToString,"((?<=\w+\s+:\s+)[A-Z0-9]+(?=\n\w+))").Value

image

Hope it helps!!

1 Like

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