I have a regexp pattern:
<^(([a-z]+)\:([0-9]+)\/?.*)$>
How do I avoid capturing the primary group?
<^(?:([a-z]+)\:([0-9]+)\/?.*)$>
The above pattern will still put the whole string 'localhost:8080' into the first (0) group. But I need to get only 2 matched groups, so that first (0) group is populated with 'localhost' and second (1) with '8080'.
Where did I make a mistake?