Important Regular Expression
^ -Start of the Expression
$ - End of the Expression
\d -Any Digit
* -Match o or more Occurring
? -End Group
+ -One or More
1. Decimal
^[0-9]+(\.[0-9]{1,2})?$
^[0-9]+(\.[0-9][0-9]?)?
2. Date
eg. 19/10/2010
eg. 2012
^d{4}
4. Year 1900-2099
^[19/20]\d{2}$
$ - End of the Expression
\d -Any Digit
* -Match o or more Occurring
? -End Group
+ -One or More
1. Decimal
^[0-9]+(\.[0-9]{1,2})?$
^[0-9]+(\.[0-9][0-9]?)?
2. Date
eg. 19/10/2010
^[0-9]{2}\[0-9]{2}\[0-9]{4}$
^(([1-9])|(0[1-9])|(1[0-2]))\-((0[1-9]) |([1-31]))\-((\d{2})|(\d{4}))$
3. Year
Comments
Post a Comment