I have the following regular expression in JavaScript which matches strings like "12:23:34:45" and "12:23"
/^([0-9]{1,2}\:){0,3}([0-9]{0,2})?$/
The problem I have is that when I look at the match data there are only ever 3 matches returned. e.g. for 12:23:34:45 the matches returned are:
12:23:34:45
34:
45
i.e. the first capturing group only reports its last value. I would like the matches to be:
12:23:34:45
12:
23:
34:
45
Is this possible?