iana has asked for the wisdom of the Perl Monks concerning the following question:
My requirement is to include the matching if clause in a loop into which I feed a list of patterns. I have looked through a lot of regex documentation, and this is not mentioned... perhaps not surprisingly ;-)$regex1 = (hello); $test="hello there!"; if ($test =~ /$regex1/) { print $1; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Storing Regex Patterns in Scalars
by Roy Johnson (Monsignor) on Mar 30, 2004 at 17:04 UTC | |
|
Re: Storing Regex Patterns in Scalars
by duff (Parson) on Mar 30, 2004 at 17:33 UTC | |
|
Re: Storing Regex Patterns in Scalars
by dragonchild (Archbishop) on Mar 30, 2004 at 17:01 UTC | |
|
Re: Storing Regex Patterns in Scalars
by saintmike (Vicar) on Mar 30, 2004 at 17:37 UTC | |
by saskaqueer (Friar) on Mar 30, 2004 at 19:44 UTC | |
|
Re: Storing Regex Patterns in Scalars
by duff (Parson) on Mar 30, 2004 at 17:02 UTC | |
|
Re: Storing Regex Patterns in Scalars
by Steve_p (Priest) on Mar 30, 2004 at 17:29 UTC | |
|
Re: Storing Regex Patterns in Scalars
by pbeckingham (Parson) on Mar 30, 2004 at 17:34 UTC |