Regex to find number inbetween

Hello everyone, is regex able to find a certain number in between characters and extract that number only for example:

ID: 7312115557086
my ID is: 7312115557086.
Id number: 7312115557086, thank you.
policy no: 134569.

Please note ID number is always 13 digits, is it possible to just extract the digits in between letters or characters

Hi @Anelisa_Bolosha1

Use the below regular expression,

- Output = System.Text.regularexpressions.regex.match(Input.toString,"\d{13}").Value

Hope it helps!!

1 Like

Hello @Anelisa_Bolosha1

Check the below workflow and output,

\d means matching any digit character (0-9)
{13} means Preceding tokens (count of items)

Is it the required output, Or if you want any modifications in it let me know.

Happy Automation!!

Hi,
To prevent match 14 or higher digits, the following pattern might be better.

image

System.Text.RegularExpressions.Regex.Matches(strData,"\b\d{13}\b")

Sequence1.xaml (7.5 KB)

Regards,

2 Likes

Aah thank you so much it worked :slight_smile:

Its my pleasure… @Anelisa_Bolosha1

Then mark my post as solution to close the loop.

Happy Automation!!

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