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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
(^(\d+)$)|(^(\d{1,3}[ ,\.](\d{3}[ ,\.])*\d{3}|\d{1,3})$)
Description
Searches for number greater than 0 with thousand delimiter as space, comma or period.
Matches
1 234 567 | 1.234.567.890 | 1,234
Non-Matches
-12,990 | 100.03 | 0,05
Author Rating: Not yet rated. Peter Petrus
Source
Your Rating
Bad Good

Enter New Comment

Title

Name

Comment

Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Title: Improved grouped number recognition
Name: Stephen Samuel
Date: 6/1/2007 6:30:28 PM
Comment:
This pattern matches a number with thousands delimiters, but ensures that the delimiters aren't switched around. /^\d{1,3}(([ ,.]?)\d{3}(\2\d{3})*)?$/ allowed: 123,456,789 | 123 456 | 3.456 | 3456 rejected: 123,567.789 | 123.456 789


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