How to get multiple regex matches in Java?

ripper234 picture ripper234 · Aug 12, 2009 · Viewed 17.2k times · Source

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

Answer

Aaron Digulla picture Aaron Digulla · Aug 12, 2009

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