in reply to help required for regexp
Nobody seems to have posted a complete solution that actually works.
use strict; use warnings; my %Hidlabels = ( '3333' => 1, '4444' => 2, '2222' => 3 ); my $str = 'f3333_4444_2222'; $str =~ s/f(\d+)/$Hidlabels{$1}/g; print $str;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: help required for regexp
by choroba (Cardinal) on Dec 07, 2011 at 11:27 UTC | |
by TJPride (Pilgrim) on Dec 07, 2011 at 11:33 UTC | |
by choroba (Cardinal) on Dec 07, 2011 at 11:42 UTC | |
by TJPride (Pilgrim) on Dec 07, 2011 at 13:26 UTC | |
by Anonymous Monk on Dec 07, 2011 at 11:50 UTC |
In Section
Seekers of Perl Wisdom