I have the following regex for validating a date of format mm/yyyy
. For month should be greater than current and year should be current or till 2018.
^((0[8-9]|(1[0-2])))\/((16))|((0[1-9])|(1[0-2]))\/((2016)|(2017)|(2018))$
In case of current year month should be greater than current month. but for years greater than current, it should validate all months.
With this current regex, it validates 08/2016
too. However, I want it to validate 09/2016
onwards. Whats wrong with this regex?
P.S For some reasons, I have to validate dates with this regex. So kindly don't suggest to validate dates with built-in date functions