Numbering of subgroups starts with 1, 0 is the full text. Just go till count+1 with your loop.
More Related Contents:
- Java: splitting a comma-separated string but ignoring commas in quotes
- Split string with dot as delimiter
- Use String.split() with multiple delimiters
- Java how to replace 2 or more spaces with single space in string and delete leading and trailing spaces
- Java Regex Capturing Groups
- SCJP6 regex issue
- Get the index of a pattern in a string using regex
- Regular expression for excluding special characters [closed]
- How to determine if a number is a prime with regex?
- Java regex to extract text between tags
- Java regex: Repeating capturing groups
- Why does this Java regex cause “illegal escape character” errors?
- java.util.regex – importance of Pattern.compile()?
- Any character including newline – Java Regex
- How do I create a Stream of regex matches?
- Regex to match words of a certain length
- Java regular expression OR operator
- What is the difference between `Greedy` and `Reluctant` regular expression quantifiers?
- Understanding regex in Java: split(“\t”) vs split(“\\t”) – when do they both work, and when should they be used
- Regex reuse a pattern to capture multiple groups?
- Regex for checking if a string is strictly alphanumeric
- Java Regex pattern that matches in any online tester but doesn’t in Eclipse
- Java Pattern Matcher: create new or reset?
- Regular Expression for matching parentheses
- Java Regex – Using String’s replaceAll method to replace newlines
- Replace a String between two Strings
- Regex to remove spaces between numbers only
- Regex Pattern Catastrophic backtracking
- Print regex matches in java
- regex replace all ignore case