Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiline Search and Replace in Atom editor

I want to find this:

<p> various text and code </p> 

...and replace it with completely different text. Atom doesn't seem to have a multi-line RegEx flag. How can I accomplish this?

like image 761
Michael Innes Avatar asked Jan 06 '17 01:01

Michael Innes


People also ask

How do I change all occurrences of a word in an Atom?

You can select several occurrences of the same word using ctrl + d repeatedly, or select all the occurrences by typing alt + F3 .


1 Answers

The regular expression (.|\r?\n)*? is what you're looking for.

Used in the example above, <p>(.|\r?\n)*?</p> will select all three lines and you can then either replace or delete those lines.

like image 86
Michael Innes Avatar answered Sep 25 '22 12:09

Michael Innes