I am having a slight problem in Regular expressions, I would like to check if my string is in the range of 2008-13.
This is were I won’t to place the Regex
Array[k].startsWith("")
I have tried so far:
(200+[8-9])|(201+[0-9])
and
^20+[0-1][0-9]$
but the second one I think it will give me 2000-2019.
I would appreciate any help.
Your mistake is in using
+. Fix your regex as following:(200[8-9])|(201[0-9])But better extract the year, parse it and verify as integer:
This is much more robust for future modification: the year top and bottom values can be read from file, DB etc in future.