|
Uri Guttman |
at Sep 3, 2011 at 9:18 pm
|
⇧ |
| |
"JF" == Jon Forsyth writes:
JF> According to the grep manual page I can use the -P option to use
JF> Perl regular expressions as follows:
JF> grep -P PERL_REGEX INPUT_FILE
just to let you know, nothing but perl can run perl regexes. all the
ones that claim it are doing subsets and in some cases not even close
anymore.
JF> however, I cannot get the following pattern to match a literal
JF> dollar sign:
JF> grep -P makan\$ file.txt
you are escaping that from the shell but the 'perl' regex will then make
it match the end of a line or before a newline. you need to quote it
against the shell with '' and keep the \ in there.
uri
--
Uri Guttman -- uri AT perlhunter DOT com ---
http://www.perlhunter.com --
------------ Perl Developer Recruiting and Placement Services -------------
----- Perl Code Review, Architecture, Development, Training, Support -------