RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Expressions by User

   Displaying page 1 of 1 pages; Items 1 to 2
Title Test Details Positive or Negative Integer with Commas
Expression
^[-+]?(\d?\d?\d?,?)?(\d{3}\,?)*$
Description
This pattern matches on Integer values. Handles leading positive or negative signs. Supports commas where only the leading group can have less than three digits.
Matches
+1 | -2 | 3,000 | 1,234,567
Non-Matches
A | 1,23 | 2,34,567 | 1.0
Author Rating: Not yet rated. Bret Stateham
Title Test Details Positive or Negative Decimal with Commas
Expression
^[-+]?(\d?\d?\d?,?)?(\d{3}\,?)*(\.?\d+)$
Description
This pattern matches decimal values. It supports option leading positive or negative symbols. Supports commas where only the leading group can have less than three numbers.
Matches
+1.0 | -3 | 1,234.00 | 1,234,567
Non-Matches
A | 1,23 | 1,23,456
Author Rating: Not yet rated. Bret Stateham
   Displaying page 1 of 1 pages; Items 1 to 2

Copyright © 2001-2018, RegexAdvice.com | ASP.NET Tutorials