Quantcast
Channel: Regular expression - only digits, dots,commas and first character should be $ - Stack Overflow
Viewing all articles
Browse latest Browse all 7

Answer by NobodysNightmare for Regular expression - only digits, dots,commas and first character should be $

$
0
0

My proposal (untested):

\$(\d{1,3})(,\d{3})*(\.\d+)?

we require a dollar, followed by a up to 3 digits.

then there might come more exactly 3-digit long groups.

at the end there might be a comma followed by at least one digit (or no comma and no digits)


Viewing all articles
Browse latest Browse all 7

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>