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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Up to 15 digits followed by 0,1 or 2 floating points
Expression
^[0-9]{1,15}(\.([0-9]{1,2}))?$
Description
This might seem like a contrived example but it was written to answer a question on a forum. For regex newbies you can just change the numbers in {} to change the number of required digits to suit your requirements
Matches
1 | 123456789012345 | 123456789012345.1 | 123456789012345.12 | 123456.12
Non-Matches
.12 | 12345.123 | 1234567890123456
Author Rating: Not yet rated. Matthew Harris
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

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