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

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

258

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

Copy link to clipboard

Copied

LATEST

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

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