Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

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

by tachyon (Chancellor)
on Mar 04, 2004 at 02:00 UTC ( #333762=note: print w/replies, xml ) Need Help??


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

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://333762]
help
Chatterbox?
[Corion]: marto: Heh - we've got the rain here, now. But it's only intermittently, not permanent. But funny that you should complain about rain ;)
[Discipulus]: rain? i dont remember it..
[marto]: and good news all round, Flash will die come 2020!
[Corion]: So who will be the saviour of the universe, then?!
[marto]: Corion++, asking the right questions
[marto]: the rain is back

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (6)
As of 2017-07-26 10:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (390 votes). Check out past polls.