in reply to problematice metashar regexp
This would also help prevent a potential problem: your hash maps '5' to ':' and '(' to '5'. If Perl happens to order your hash so keys finds the second of these first, Perl will change '('s in the string to '5's, then later on change those converted '5's to ':'s. tr/// does everything in one shot, so that sort of thing won't happen.# note that I used {} as the delimiter for tr/// $foo =~ tr{1234567890!@#$%^&*()-+=\\|~} {?/><:;[]{}poidjhgk5329%c1^};
$"=$,,$_=q>|\p4<6 8p<M/_|<('=> .q>.<4-KI<l|2$<6%s!<qn#F<>;$, .=pack'N*',"@{[unpack'C*',$_] }"for split/</;$_=$,,y[A-Z a-z] {}cd;print lc
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: problematice metashar regexp
by Anonymous Monk on Apr 28, 2004 at 13:49 UTC |