x Did you like it? Well, then please consider making a donation :)

Regex Tag - validate

Validate numbers

If Possible, Don't Use Regex To Validate Numbers. If at all possible, use your language. There may be functions to help you determine if the value contained by a string is a valid number. That being said, if you're accepting a variety of formats (commas, etc.) you may not have a choice.

Type: match, Date: 7/12/2015 4:07:04 PMAuthor: stackoverflow

Regular expression to extract the year (1900 - 2099) from a string

Getting year from text. If you want validate textbox value - use this pattern with "^" and "$": ^((19|20)\d{2})$

Type: match, Date: 3/28/2015 4:38:20 PMAuthor: admin