I have a string that would represents a duration.
it can be like one of the following :
10d12h59m
10d12h
10d
12h
70
number before the "d" represents days ,number before "h" represents hours ,number before "m" represents minutes and if its just number then it means minutes.
I would like a javascript regular expression that will match that string.
If you only want to check if it matches:
/^(?:\d+d(?:\d+h(?:\d+m)?)|\d+[dh]?)$/examples: