in reply to I match a pattern in regex, yet I don't get the group I wanted to extract for some reason
I cannot duplicate your error. Are you using 'strict'? If not, replacing a numeric '1' with a lower case 'L' in "$1" would cause this result. I mention this because I misread the last character in "$tagl".
Bill
In Section
Seekers of Perl Wisdom