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
Back to
Seekers of Perl Wisdom