Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Re: Learn vi/vim in 50 lines and 15 minutes

by thelenm (Vicar)
on Mar 04, 2004 at 01:31 UTC ( #333752=note: print w/ replies, xml ) Need Help??


in reply to Re: Learn vi/vim in 50 lines and 15 minutes
in thread Learn vi/vim in 50 lines and 15 minutes

Good post... a minor nit, though. You can use + in Vim regexes, but you have to precede it with a backslash. Vim regexes and Perl regexes are not the same (knowing when to use backslashes often throws me off), but I think they're much more similar than they are different.

-- Mike

--
XML::Simpler does not require XML::Parser or a SAX parser. It does require File::Slurp.
-- grantm, perldoc XML::Simpler


Comment on Re: Re: Learn vi/vim in 50 lines and 15 minutes
Re: Re: Re: Learn vi/vim in 50 lines and 15 minutes
by tachyon (Chancellor) on Mar 04, 2004 at 02:00 UTC

    OK so I lied (it was just a little one!) It really uses the abortive GNU regex syntax that is just different enough from Perl to s!+t you if you really know perl REs.....it is like grep. My usual greps are called re and re! linked into /usr/bin. They look like:

    [root@devel3 root]# cat /usr/bin/re #!/usr/bin/perl die "Usage re [RE]\nFull Perl grep on STDIN\n" unless @ARGV == 1; my $re = qr/$ARGV[0]/; while(<STDIN>) { print if m/$re/; } [root@devel3 root]# cat /usr/bin/re! #!/usr/bin/perl die "Usage re [RE]\nFull Perl grep on STDIN\n" unless @ARGV == 1; my $re = qr/$ARGV[0]/; while(<STDIN>) { print if ! m/$re/; } [root@devel3 root]# cat some.file | re "some perl re"

    cheers

    tachyon

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://333752]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2015-07-05 06:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls