Alternations in regexen are a single pipe, not a double pipe. Your version has two null alternations, and will thus match the empty string, and since it isn't anchored, anything:
$ perl -le 'print "foo" if "zoombots" =~ m/baz||bar/' foo
In reply to Re^2: What is wrong in this
by fishbot_v2
in thread What is wrong in this
by skamalakannan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |