I have a user input to validate:
String is made up of Part 1 + Part 2. Part 1 can be '$Now' or '$Today' or '$CurrentMonth'. Part 1 is mandatory.
Part 2 can be '+' or '-' Followed by number and a unit. Number can be any number, and Unit should be one of 'm','h','d'. Part 2 is optional
Some valid examples:
'$Now',
'$Today',
'$CurrentMonth',
'$Now + 2h',
'$Now - 4m',
'$Now + 6d',
'$Today - 7d'
Tried several patterns but wan't able to get through as I have very little knowledge on regex.