Get particular string

The have changed phone number 123-456-7890 to phone number 456-123-3456. Not further transaction are allowed the invalid phone number. Please proceed with a new search using phone number 456-123-3456 to apply the change request for 123-456-7890, click complete.

Above is my string value, i want new phone number value for expected output : 456-123-3456

Quick n dirty Regex

(?<=using phone number )\b[\d\-]+\b

[CheatSheet] - System.Text.RegularExpressions | RegEx - News / Tutorials - UiPath Community Forum

1 Like

Hi @AJITH_SK

Please use the below regex expression

(\d+\-\d+\-\d+)(?=\.)

Use the below in assign activities

Str_InputVariable = The have changed phone number 123-456-7890 to phone number 456-123-3456. Not further transaction are allowed the invalid phone number. Please proceed with a new search using phone number 456-123-3456 to apply the change request for 123-456-7890, click complete.

str_Output = System.Text.RegularExpressions.Regex.Match(Str_InputVariable,"(\d+\-\d+\-\d+)(?=\.)").Value

Regards

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