How can I create a regex (which will be used with preg_match
) for the following format 1.123,12
?
How can I create a regex (which will be used with preg_match
) for the following format 1.123,12
?
Pattern to get numbers from 0 to 9,999,999.99: " ((?:\d\.)?(?:\d{1,3}\.)?\d{1,3},\d{1,2})|(\d)
"
pattern above gets numbers in the following formats:
Example on Regex101 .
I believe that you should have better ways to resolve this without regex
, but I know little of php
.