The IPv6 regexes use non-capturing groups - i.e. (?:pattern) - whereas
the IPV4 pattern uses capturing groups - i.e. (pattern).

Just wondering why they don't all use non-capturing groups, given that
the patterns are only used in boolean matches() methods?

If it more efficient to use non-capturing groups, perhaps they should
be use throughout?

If efficiency is not a concern, then the IPv6 patterns would be easier
to read if they used non-capturing groups, as that would mean the
colon would only appear as itself rather than sometimes as itself and
sometimes as part of (?:pattern). In some cases the pattern begins
with : which looks odd.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to