in reply to array filter
Ikegami's solution to build up a big filter-regex might be faster, but maybe this one is just simpler
(tested in perlshell)@main=("In to the wild" ,"The catcher in the rye") ; @filters=("the","in"); for $filter (@filters) { s/\Q$filter\E//ig for @main; } print "@main"; # to wild catcher rye
\Q and \E are for quoting possible regexcode in @filter. If you want to get rid of whitespaces or dupplicate replacements and so on just improve the regex, it's up to you!
Cheers LanX
- - - - - Which song???
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: array filter
by Anonymous Monk on Nov 18, 2008 at 11:34 UTC | |
by LanX (Saint) on Nov 18, 2008 at 11:39 UTC | |
by Anonymous Monk on Nov 18, 2008 at 11:46 UTC | |
by LanX (Saint) on Nov 18, 2008 at 11:52 UTC | |
by Anonymous Monk on Nov 18, 2008 at 11:48 UTC | |
by LanX (Saint) on Nov 18, 2008 at 11:47 UTC |