in reply to Creating regex from arrays
I see only one caveat: if the character "I" can occur in your original array, you will have to escape that. Something like:
And yes, I prefer # over / for regexes to avoid the falling toothpick syndrome.$tomatch = join( '|',map {s#|#\\|#s; $_} @results );
Liz
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Creating regex from arrays
by diotalevi (Canon) on Jul 29, 2003 at 16:31 UTC | |
|
Re^2: Creating regex from arrays (oops)
by tye (Sage) on Jul 29, 2003 at 17:03 UTC | |
by liz (Monsignor) on Jul 29, 2003 at 18:13 UTC | |
by tye (Sage) on Jul 29, 2003 at 23:19 UTC | |
by liz (Monsignor) on Jul 30, 2003 at 07:22 UTC |