spectre has asked for the wisdom of the Perl Monks concerning the following question:
I'm checking a variable for a regex that may or may not be there, using the following:
Is there a way I can force it to look at the first expression rather than (As it appears to be doing) whichever comes first?
Regards,
spectre
And it always matches nothing when I use the former 2 examples.$var=~/(?:regex(catch_this)|)/; # My regex or nothing I've also tried: $var=~/(?:regex(catch_this)|.{0})/; #My regex or very literally nothin +g It always matches my regex when it looks like this: $var=~/regex(catch_this)/;
Is there a way I can force it to look at the first expression rather than (As it appears to be doing) whichever comes first?
Regards,
spectre
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Regex OR'ing
by tye (Sage) on Jul 28, 2000 at 03:13 UTC | |
by spectre (Scribe) on Jul 28, 2000 at 03:23 UTC | |
Re: Regex OR'ing
by tye (Sage) on Jul 28, 2000 at 07:16 UTC | |
by spectre (Scribe) on Jul 28, 2000 at 20:47 UTC | |
Re: Regex OR'ing
by Fastolfe (Vicar) on Jul 28, 2000 at 19:13 UTC |
Back to
Seekers of Perl Wisdom