String manuplation containing number

Hi,

I would like to remove the characters before the number
Eg: Room Ter 48 Murray st, Marrickville nsw 2004

Expected ouput: 48 Murray st, Marrickville nsw 2004

The address changes for each iteration but i only want the address from a number anything before the number i wish to remove. Can you help me with this.

Thanks.

Hi @RACHEL_PAUL

The following RegEx pattern gets you any data before the occurrence of 48 on the above example:

^.*?(?=\d)

image

You can use the same to replace the captured data will “” value, so that you will get the desired result.

UiPath Syntax:

System.Text.RegularExpressions.Regex.Replace(address, "^.*?(?=\d)", "")

Output:

image

Hope this helps,
Best Regards.

@RACHEL_PAUL

Another way

System.Text.RegularExpressions.Regex.Match(str,"\d.*").value

image

cheers

Please try this:

Hi @RACHEL_PAUL

You can use the Regex expressions to get the expected output.

System.Text.RegularExpressions.Regex.Matches(yourstringinput.ToString,“(\d+\s\w*\s*\w*,\s\w*\s\w*\s\d*)”)

image

Hope it helps!!