#!/usr/bin/env perl use strict; use warnings; use feature 'say'; my $string = "<Word>Cat<Digit>1 blah blab blah <Word>Dog<Digit>0"; while ( $string =~ m/<Word>(\w+)<Digit>(\d+)/g ) { say "Matched Word: $1"; say "Matched Digit: $2"; } __END__ Matched Word: Cat Matched Digit: 1 Matched Word: Dog Matched Digit: 0
In reply to Re: Retrieving Regex matched Group name
by frozenwithjoy
in thread Retrieving Regex matched Group name
by Samman_Mahmoud
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |