I have the following regular expression for checking the time format HHMM
([0-1][0-9]|[2][0-3])([0-5][0-9])
This works perfect, but now I faced a problem with my application. It requires that the result of the upper expression returns the time in only one group, not in two. Is there a possibility to bundle parts of the regular expression without grouping them?
Thanks in advance …
Yes, use non-capturing parentheses:
You can of course enclose the entire regex in a capturing group if your app requires at least one group.