Regular Expression For Year

Category: Numbers | Views Total: 61 views

A regular expression to match and validate a 4-digit year (from 1900 to 2099).

/^(19|20)[\d]{2,2}$/

Year Examples:

  • 2020
  • 1900
  • 1980

See Also:

Rate This Regex
Sending
User Review
0 (0 votes)

Leave a Reply