Search code examples
regexnotepad++

How to delete everything between two 2 lines (34 to 51)?


I have a lot of documents that i need to delete everything that are between this to lines 34 to 51

The documents dosn´t any form to use a

"Here is the beginning of the line 34" random text
Random text
Random text
Random text
Random text
Random text
    .
    .
    .
    .
"Here is the beginning of the line 51" more random text

(the code dont have textualy "line 34 or line 51") How can this be done?

I currently try to use some regular expression to use in the notepad++ but i dont now how to indicate to go to "x" line and delete everything before the line "y"


Solution

  • Try ((?:.*?[\n]){33})((?:.*?[\n]){18})(.*)

    With checkbox "dot match EOL" checked.

    Demo

    And replace with $1$3