in reply to Regular expression question
Though I would suggest benchmarking to find out what works best for you (if you have a one to one correspondence between characters then tr/// should be quicker than my suggestion here).my %hash = ( a => 'A', b => 'B', ... ); s/(.)/$hash{$1}/eg;
-- Hofmator
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Regular expression question
by Wonko the sane (Curate) on Jan 16, 2003 at 16:50 UTC |