regex - Regular expression numbers with dots and commas -


I need a regular expression that behaves numbers with numbers and commas as well. Comma should not be treated as a thousand separator.

Example:
9.8
9 8

9.8 Both

P> I tried it, but it does not work .

  ^ (\ d + (?: [\. \,] \ D {2}) | $  

Your regex ^ (\ d + (?: [\. \,] \ D {2})? $ $ Milan Number if you want to match any number of decimal (1 or more), use it:

  ^ (?: \ D + (?: [.,] \ D +)? | $ $  

Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -