Search code examples
regexnotepad++

Regex to delete lines between double square brackets


Have a document with multiple multi-line sections that look like:

[[
this
is
an
example
]]

Would be great to have a regex statement that could iterate through the document and remove all the lines between the bracket sets, leaving one blank line between like

[[

]]

Solution

  • find

    \[\[(.*?\r\n)*?\]\]

    replace with:

    \[\[\r\n\]\]

    enter image description here