Results 1 to 2 of 2
Thread: Mather groups order
- 04-08-2012, 07:05 PM #1
Member
- Join Date
- Apr 2012
- Posts
- 2
- Rep Power
- 0
Mather groups order
Documentation says:
Capturing groups are numbered by counting their opening parentheses from left to right.
Java Code:final String regex = ".*(::.*::).*"; Pattern pattern = Pattern.compile(regex); String query = "::words.txt:: asdf\"::11.txt::\""; Matcher matcher = pattern.matcher(query); String result = matcher.group(1);
What do I wrong?
How to capture first inclusion?
- 04-08-2012, 07:52 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 14,422
- Blog Entries
- 7
- Rep Power
- 29
Similar Threads
-
Pattern problem (capturing groups)
By BMF in forum New To JavaReplies: 0Last Post: 07-14-2011, 01:52 PM -
Groups of swing objects
By plrca2 in forum AWT / SwingReplies: 12Last Post: 12-07-2010, 03:56 AM -
how to sort jtable with row groups
By mordjah in forum AWT / SwingReplies: 0Last Post: 10-25-2010, 06:23 PM -
Get all groups from a regular expression match?
By johann_p in forum New To JavaReplies: 0Last Post: 05-16-2008, 08:50 PM -
Capturing Groups using regular expressions
By Java Tip in forum Java TipReplies: 0Last Post: 12-25-2007, 12:19 PM
Bookmarks