palkia has asked for the wisdom of the Perl Monks concerning the following question:
Thank you very much for any assistance, and have an awesome day ☺... if($fName =~ /^([\[\(].+?[\]\)])/) { #pref detected. generalizing digits my $pref = '^\Q'.$1.'\E'; $pref =~ s/\d++/\\E\\d++\\Q/g; #finding indexes of matches to this prefix my @matchIndexes; for(my $mex=0;$mex<@fNames;$mex++) {if($fNames[$mex] =~ /$pref/i){push(@matchIndexes,$mex);}} ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Q regex escape within variable
by Eily (Monsignor) on Mar 28, 2017 at 08:36 UTC | |
by palkia (Monk) on Mar 28, 2017 at 09:37 UTC | |
|
Re: Q regex escape within variable
by AnomalousMonk (Archbishop) on Mar 28, 2017 at 08:53 UTC | |
by palkia (Monk) on Mar 28, 2017 at 10:17 UTC |