Okay, I can find a Regex match in a string, and do some captures.
Now, what if my string has many matches? Let’s say my code finds out the number inside parenthesis in a string. The code will find the number in a string like
(5)
But what if the string is
(5) (6) (7)
I need a way to iterate through these three elements. I’ve seen tutorials, but they seem to only talk about one-time matches…
If I understand correctly, you could use the
String#scanmethod. See documentation here.