How to search/replace quotes within quotes in text?

Explorer ,
Oct 27, 2020 Oct 27, 2020

Copy link to clipboard

Copied

I have multiple scenarios of text and quotes and i need to do replacement.

 

Scenario A: In text with quotes within quotes i want use: « » as first quotes and “ ” for internal quotes.

 

Scenario B: In text with only one level of quotes i want to use: “ ”

 

Then, which GREP(s) i can use for:

 

Solve scenario A:

Search content as:

«Lorem "ipsum" dolor sit amet»

 or

«Lorem 'ipsum' dolor sit amet»

or 

«Lorem «ipsum» dolor sit amet»

 

And replace with:

«Lorem “ipsum” dolor sit amet»

 

Solve scenario B:

 

Which GREP i can use to search text as:

«Lorem ipsum dolor sit amet»

 

And replace by:

“Lorem ipsum dolor sit amet”

 

Thanks for your help.

TOPICS
How to

Views

118

Likes

translate

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
Adobe Community Professional ,
Oct 27, 2020 Oct 27, 2020

Copy link to clipboard

Copied

Interestingly, quote marks find/change (Text tab) to different characters based on whether the language is English, French, or German (Swiss, Austrian). Your characters are a mixture of English and French quote marks in your example.

 

Quotation Marks                                  Text                      GREP
Any Double Quotation Mark . . . . . . . . " . . . . . . . . . . . . "
Any Single Quotation Mark . . . . . . . . . . ' . . . . . . . . . . . . . '
Straight Double Quotation Mark " . . .^" . . . . . . . . . . .~"
Double Left Quotation Mark “ . . . . . . ^{ . . . . . . . . . . ~{
Double Right Quotation Mark ” . . . . . .^} . . . . . . . . . . ~}
Straight Single Quotation Mark ' . . . . .^' . . . . . . . . . . . ~'
Single Left Quotation Mark ‘ . . . . . . . . .^[ . . . . . . . . . . ~[
Single Right Quotation Mark ’ . . . . . . . .^] . . . . . . . . . . .~]

 

In your GREP searches, you might want to make the search a shortest match by adding the ? after your expression.

 

Interestingly, I cannot find a discrete GREP or metacharacter that represents << or >>. Anyone know of one?

Mike Witherell

Likes

translate

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