RegEX Match

I have to check whether my variable shoulde any of regex pattern out of mentioned pattern, How I should check.

It should accept 12,12.00,12.12 only not 12.123 / 12.1234

1 Like

Hi @Shirish,

Pattern: [0-9]+(\.[0-9][0-9])?

Regards,
Arivu

5 Likes

@Shirish Refer below link

Hey @Shirish

Try this:- ^\d{1,2}(?:.\d{1,2})?$

it will only accept values having 2place after a point.

Regards…!!
Aksh

1 Like

Use IsMatch activity with the Regex pattern
pattern -
^\d\d(.?)(\d?)(\d?)

2 Likes

Hi Team,

I want a regex which accept max 13 digits between 0-9 before decimal and only 2 digits after decimal between 0-9. Please help

Hi @Shirish,

Try this pattern

\d{1,13}\.\d{1,2}

Regards,
Arivu

can you be more clear max 13 digits means even you will have 14 digits before . then also it takes 13 digits from starting or should only match with that number which have 13 digits before . and 2 after point?

^\d{1,13}(?:.\d{1,2})?$

Url - regex101: build, test, and debug regex

Regards…!!
Aksh

1 Like

The No should have only 13 or less than digits before . and only 2 digit or less than 2 digits after . The no should be less than 9,999,999,999,999.99.

@aksh1yadav
The No should have only 13 or less than digits before . and only 2 digit or less than 2 digits after . The no should be less than 9,999,999,999,999.99. If there is no dot then it should accept only 13 or less than 13 digits.

Hey @Shirish

Try this pattern and let me know - [1]{0,13}(.[0-9]{1,2})?$

Url - regex101: build, test, and debug regex

Regards…!!
Aksh


  1. 0-9 ↩︎

it satishfy all condition except that it is not accepting number less than 13 digits. It should accept it. Please help

Check updated Post above.

Regards…!!
Aksh

@aksh1yadav

It is accepting more than 2 digits after decimal which should not. Please reply.

Hey @Shirish

Check edited post again . forgot to escape .

[1]{0,13}(.[0-9]{1,2})?$

Regards…!!
Aksh


  1. 0-9 ↩︎

1 Like

Thanks @aksh1yadav. Issue resolved

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