in reply to regex for multiple dates

I suggest you read perldoc perlre and find the spot about “global matching,” the i and g modifiers; and the pos function (perldoc -f pos).

You can, in short, ask Perl to look for a pattern and to then remember where it left off, so that you can search for other patterns in the rest of the string.   pos also allows you to go back to those positions.

(Also note that undef, not zero, is the correct thing to reset pos to, when you want to start searching from the start of the string again!   Yeah, you’re darned right “I speak from experience” on that one ...)