Search code examples
javaregexmultiple-matches

How to get multiple regex matches in Java?


How can I find all substrings that match a regex in Java? (Similar to Regex.Matches in .Net)


Solution

  • Create a Matcher and use find() to position it on the next match.