Re: MatchResult-->Group Issue
"Daniel F. Savarese" <[email protected]> Fri, 11 Jun 2010 10:08:27 -0400
| Newsgroups | gmane.comp.jakarta.oro.user |
|---|---|
| Message-ID | <[email protected]> |
In message <[email protected]>, Sand eep Deshpande writes: >Also results contains 8 results instead of 6 matches. >So, how do I make it to contain only top-level matches in the results? How >to make it to match only 6 results as I am expecting.. >I know that this problem is being caused by inner brackets () of the >IP_ADDR_REGEX .. >How to fix it?? Use non-capturing parentheses for groups you don't want to capture. For example, (foo((bar)) produces two captured groups: foobar and bar. In contrast, (foo(?:bar)) produces one captured group: foobar. daniel