Jump to content


G+_Ubaid azm
 Share

Recommended Posts

    <<== will be gone if i execute perl pi -e ’s/\<\!-[^\>]+--\>//g’ *.txt

 

if i tried to remove strings from line...:

 

this will be gone  <<==perl -pi -e ’s/this[^gone]+gone//g’ *.txt 

does not work... help me please... how do i do this..

Link to comment
Share on other sites

Your regular expression is not working the way it should.  The way you have it written, you are telling it to match "this" followed by 1 or more characters that are not g, o, n, or e, then followed by "gone".  This won't work because there is an "e" in "be" that spoils that match.  Something like s/this.*gone// will work.

Link to comment
Share on other sites

 Share

×
×
  • Create New...