in reply to Returning regexp pattern that was used to match
This is easy enough - just test each portion individually. When it matches then you know that the current pattern is the one that matched.
sub do_this { my $self = shift; my %actions = %{shift()}; for my $rx ( keys %actions ) { if ( $self->{'find'} =~ $rx ) { print "Found it with '$rx'\n"; last; } } }
|
|---|