Let’s say I’m scanning through a page of raw html looking for this regex. (The quote mark on the end is intentional).
m/(https?:\/\/.*?(?:'|"))/
This pattern is likely to match ~ 100 times. What is a common perl idiom/a quick way to iterate through a list of all capture group matches?
From the perlretut (a very fine tutorial)
You can use
whiletogether with thegmodifier to iterate over all matches, with$1you get the content of your capturing group 1, and in this example from the tutorial you get also the position withpos.