How to check a 5 digit text?

Hello!

I would like to check a 5 digit text in a full text.

“This is the example of a 12345 text”. In this case we can see 12345 is a number of 5 digits.

How can I check if the text contains that?
Thanks!

Should answer it for you :slight_smile:

From there you just use .length to get the length of what you extract

@pal1910

If you like to check 12345 in a string use this regex

Assign activity

boolean_variable = system.Text.RegularExpressions.Regex.IsMatch(“This is the example of a 12345 text”,"12345")

Or any 5 digit integer in your string use this regex

boolean_variable = system.Text.RegularExpressions.Regex.IsMatch(“This is the example of a 12345 text”,"\d{5}")

Returns True if pattern matches.

Regards,
Ranjith