Skip to main content
Known Participant
February 19, 2022
Question

How do you chain GREP patterns in InDesign?

  • February 19, 2022
  • 1 reply
  • 299 views

In regex, I can use this to highlight quotation marks:

"([^"]*)"

And if I want to add another pattern, and can use the pipe symbol like this:

\b("([^"]*)"|'([^']*)')\b

This will match single and double quotes. However this syntax with the pipe doesn't seem to work in InDesign.How can I get this to work?

This topic has been closed for replies.

1 reply

Known Participant
February 19, 2022

I can't edit the obvious mistake out, so here's the question again, without the mistake that I am not allowed to correct:

In regex, I can use this to highlight quotation marks:

"([^"]*)"

And if I want to add another pattern, and can use the pipe symbol like this:

"([^"]*)"|'([^']*)'

This will match single and double quotes. However this syntax with the pipe doesn't seem to work in InDesign. How can I get this to work in GREP in InDesign?

 

Peter Spier
Community Expert
Community Expert
February 19, 2022

You can put them together in a single class as literals: ['"]