Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Negative look ahead

by jesuashok (Curate)
on Mar 09, 2007 at 09:41 UTC ( [id://603954]=note: print w/replies, xml ) Need Help??


in reply to Negative look ahead

perl -ne 'chomp; !/^<title>/ ? print "<para>$_</para>\n" : print "$_\n +"' <input_file>

Replies are listed 'Best First'.
Re^2: Negative look ahead
by pKai (Priest) on Mar 09, 2007 at 10:16 UTC

    See also perlrun, if you want to wrap ++graff's code into a 1-liner, using further options.

    perl -ple '$_="<para>$_</para>" if !/^<title>/'

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (2)
As of 2024-04-25 05:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found