# Create a hash of codes for substitution my %directSubs = ( qr/\[h(\d)\]/ => '<h$1>', qr/\[\/h(\d)\]/=> '</h$1>' ); # Substitute the codes while(($a,$b) = each %directSubs){ $line =~ s/$a/$b/gi; }
In reply to Re: Re: Making a hash of regexes
by jpfarmer
in thread Making a hash of regexes
by jpfarmer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |