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 1
Title Test Details Whole Numbers
Expression
^(([1-9]{1}\d{0,2},(\d{3},)*\d{3})|([1-9]{1}\d{0,}))$
Description
Matches whole numbers only, including comma separated. Does not allow leading zeros. To match comma separated numbers only, change "\d{0,}" to "\d{0,2}". To match 0, add "|([0])" before ")$". If you want to use it with Java's regexp match(), remove "^(" and ")$" since they are not needed.
Matches
10 | 1000 | 1,000 | 10,000,000
Non-Matches
01 | 001,000 | 1000,000
Author Rating: The rating for this expression. Robert Gasiorowski
   Displaying page 1 of 1 pages; Items 1 to 1

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