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 Number w/wo commas and decimal
Expression
((^([\d]{1,3})(,{1}([\d]{3}))*)|(^[\d]*))((\.{1}[\d]{2})?$)
Description
This re matches numbers with our without commas and with or without exactly two decimal places.
Matches
456161 | 45622.22 | 123,234,.22 | 889,456
Non-Matches
123,22 | 123.221 | 1,2,3 | 123,21.2
Author Rating: Not yet rated. John Moore
Title Test Details Valid Date
Expression
(?:(?:(?:04|06|09|11)\/(?:(?:[012][0-9])|30))|(?:(?:(?:0[135789])|(?:1[02]))\/(?:(?:[012][0-9])|30|31))|(?:02\/(?:[012][0-9])))\/(?:19|20|21)[0-9][0-9]
Description
Matches dates in mm/dd/yyyy format. Matches only valid dates -except is unable to test for a leapyear. Always allows February 29th. Allows years from 1901 to 2199.
Matches
02/21/1972 | 12/31/2199 | 09/04/1901
Non-Matches
02/31/1999 | 02-21-1972 | 06/31/2001
Author Rating: Not yet rated. John Moore
   Displaying page 1 of 1 pages; Items 1 to 2

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