Saturday, May 11, 2013

How to validate data using regex?

For the data points you've provided, use pattern "^\$[0-9]+$"


This will match strings like $230, $30, $9999999999993123, $0


This will not match strings like 10.00, 899, $12.20


No comments:

Post a Comment