• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

GREP quotation mark marks across line breaks

Engaged ,
Feb 03, 2022 Feb 03, 2022

Copy link to clipboard

Copied

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.

 

 

TOPICS
How to , Scripting

Views

216

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Feb 03, 2022 Feb 03, 2022

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

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

 

Votes

Translate

Translate
Community Expert ,
Feb 03, 2022 Feb 03, 2022

Copy link to clipboard

Copied

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

(?s)".+?"

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Feb 03, 2022 Feb 03, 2022

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Feb 03, 2022 Feb 03, 2022

Copy link to clipboard

Copied

Didn't quite get to where I wanted to go because, while it works and it's the correct answer as far as my question was framed, I should maybe have refined it a bit.

 

I'm trying to also NOT match cases that are on a single line. I'm just trying to find these multiline versions.

 

As a starting point I was experimenting with the notion of finding:

a line that starts with a double quote and then reaches the end of the line without finding any further double quotes

 

Which I thought might be this: 

^"[^"]+\n

I figured that would find the first line of each such case (which would be good enough for me to find them in a huge doc). I hadn't even got around to trying with the single-line ideas above as this has me scratching my head already as it doesn't work. What am I overlooking here. I need far more GREP experience obviously, usually when I do these things it turns out it's just the wrong approach, I'm thinking about the solution wrong!

 

This is great though, I've already learned a bit more about the single-line and multi-line from looking them in the GREP indesign book Jean-Claude's tip, though I find them quite confusingly named!

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 03, 2022 Feb 03, 2022

Copy link to clipboard

Copied

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

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

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Feb 03, 2022 Feb 03, 2022

Copy link to clipboard

Copied

LATEST

Thanks so mcuh for this. I've learned a lot.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines