in reply to how can i split a string to an array and convert it into regular expression
That of course assumes that your input isn't doing anything evil (like having a '/' in it).my @arry = <>; my $pattern = join('|', @arry); my $regex = eval("qr/$pattern/");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: how can i split a string to an array and convert it into regular expression
by ikegami (Patriarch) on Dec 08, 2007 at 19:31 UTC | |
by plobsing (Friar) on Dec 08, 2007 at 19:36 UTC |