0

I am currently editing down multiple large text files , and need to delete everything before and after text that selected by this Regex ^NewPage.+?NewPage$

For example i have this text:

V.prototype.Jb=function(){if(!this.N)  
_.k.Zj=function(a){this.H=a;dj(this,this.O);  
var Vi=function(a,b){this.B=new Oi(this);  
NewPage 1969 Q2","Fortran","2.49","NewPage  
V.prototype.Jb=function(){if(!this.N)  
_.k.Zj=function(a){this.H=a;dj(this,this.O);  

and i want to remove everything except this line:

NewPage 1969 Q2","Fortran","2.49","NewPage

Note : i must use regex because i want to edit multiple text files

1 Answer 1

0

Try something like this:

  • Find what: ^(?!NewPage.+NewPage).+
  • Replace with: Leave empty
  • Search mode: Regular expression
  • Enable Wrap around
  • Press Replace All

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.