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:
$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)/;
And it always matches nothing when I use the former 2 examples.
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?