While your example works as shown it is contrary to the docs (perlop) and also fails to explain the observed behaviour noted above.....
If ``/'' is the delimiter then the initial m is optional. With the m y +ou can use any pair of non-alphanumeric, non-whitespace characters as + delimiters. C:\>type test.pl $re =~ "^0\$"; $re =~ m"^0\$"; $re =~ '^0\$'; $re =~ m'^0\$'; $re =~ <^0\$>; $re =~ m<^0\$>; C:\>perl -MO=Deparse test.pl $re =~ /^0$/; $re =~ /^0\$/; $re =~ /^0\$/; $re =~ /^0\$/; $re =~ /CORE::GLOBAL::glob('^0$', 0)/; $re =~ /^0\$/; test.pl syntax OK C:\>
The quote and other chars can also be used without m but the results may not be intuitive.....
cheers
tachyon
In reply to Re: Re: Re: what function of this Regular Expression?
by tachyon
in thread what function of this Regular Expression?
by iwanthome
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |