Displaying page
of
pages;
Items to
Title |
Test
Details
Dollar Currency Pattern
|
Expression |
^(([1-9]\d{0,2}(\,\d{3})*|([1-9]\d*))(\.\d{2})?)|([0]\.(([0][1-9])|([1-9]\d)))$
|
Description |
Building on Joe Lynwood's Regex which makes use of a combination of Michael Ash's US Dollar amount and Bri Gipson's eliminating zero input, I've added support for values between 0 and 1. Being relatively new to regex, I hope someone would be able to spot any discrepancies with the code and its supposed function.
Edit 1: Corrected mis-match with non-decimal numbers.
|
Matches |
1,234,567.89 | 1234567.89 | 9.99 | 0.34 | 0.10 | 1234
|
Non-Matches |
1,2345,67.89 | 1234,345,678.0 | 0 | 0.00 | 123. | .123
|
Author |
Rating:
Fong C.D.
|
Displaying page
of
pages;
Items to