Reputation: 2291
Just say I have the following text to be processed by regex:
red red red blue
To match the text, I use the following regex:
(red\s*)+(blue)
Now, my question is that how to capture the first groups (not the first group) ?
Upvotes: 0
Views: 61
Reputation: 990
Just add parenthesis around what you want to capture, in this case the whole +
ed group:
((red\s*)+)(blue)
Upvotes: 2