Is there a way to get the inside of capturing groups and to match multiple times? #816
-
Have I just missed it in the documentation?
When I use this with (a)(b)(c) and
I only get the first match, it's also surrounded with () still. Do you just have to keep slicing the input using the returned end value? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
It's difficult for me to help you here because I can't parse your question (there are multiple ways of interpreting it), and you don't say what output you want or what problem you're trying to solve. So given that, I'll ask, have you looked at the documentation for capturing groups? It's in one of the first examples: https://docs.rs/regex/1.5.4/regex/#example-replacement-with-named-capture-groups And there is more here: https://docs.rs/regex/1.5.4/regex/struct.Regex.html#method.captures and https://docs.rs/regex/1.5.4/regex/struct.Regex.html#method.captures_iter |
Beta Was this translation helpful? Give feedback.
It's difficult for me to help you here because I can't parse your question (there are multiple ways of interpreting it), and you don't say what output you want or what problem you're trying to solve.
So given that, I'll ask, have you looked at the documentation for capturing groups? It's in one of the first examples: https://docs.rs/regex/1.5.4/regex/#example-replacement-with-named-capture-groups
And there is more here: https://docs.rs/regex/1.5.4/regex/struct.Regex.html#method.captures and https://docs.rs/regex/1.5.4/regex/struct.Regex.html#method.captures_iter