in reply to Re: Re: what function of this Regular Expression?
in thread what function of this Regular Expression?
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: what function of this Regular Expression?
by Abigail-II (Bishop) on Apr 02, 2004 at 08:38 UTC | |
by pelagic (Priest) on Apr 02, 2004 at 08:47 UTC | |
|
Re: Re: Re: Re: what function of this Regular Expression?
by BrowserUk (Patriarch) on Apr 02, 2004 at 03:53 UTC |