Skip to main content
Inspiring
February 3, 2022
Answered

GREP quotation mark marks across line breaks

  • February 3, 2022
  • 1 reply
  • 626 views

I'm trying to GREP the whole of something similar to the following. There are paragraph returns at the end of each line. Regardless of my/your/our thoughts on the structure, I'd like to find a GREP that can capture the lot, including the quotes.

 

"Lorem ipsum dolor sit amet.

Aenean a finibus odio.

Vivamus vitae eleifend quam, vel faucibus quam.

Donec mollis ut arcu a pretium.

Suspendisse vitae egestas erat."

 

The paragraph returns are breaking my attempts however. I'm not after something that I'll hit "Replace all" on, I'm happy to supervise it. So not to worry too much about false positives.

 

 

This topic has been closed for replies.
Correct answer jctremblay

If you don’t have quotes inside other quotes on a line... this will make it.

"[^"]+\r([^"]+\r?)+"

 

1 reply

jctremblay
Community Expert
Community Expert
February 3, 2022

Add the Single Line modifier On at the begining...

(?s)".+?"

 

MrZZYAuthor
Inspiring
February 3, 2022

Thanks! Especially for how quickly you came back on this!