Regular expression matches php

I need to execute regex in php. The fact is that.

2 digits before decimal and 2 digits after decimal.

the problem is that it may or may not have a decimal number even after decimal digits.

How can I write an expression for this?

+3
source share
1 answer

You can try:

\d{2}(?:\.\d{2})?
+2
source

Source: https://habr.com/ru/post/1770284/


All Articles