Reply To: Need help with GREP

#34332
Jack Brannen
Member

Hi Elaine,

I think I can help with this. First the query, then a translation. I have tested this in InDesign and it finds all three of your examples above. It should work for others as well.

\(\d+(-|?|?)\d+( B\.C\.)?( A\.D\.)?\)

The translation of this is:
1. A literal open parenthesis
2. Followed by one or more digits
3. Followed by either a hyphen OR an en dash OR an em dash
4. Followed by one or more digits
5. Optional: followed by the string ” B.C.”
6. Optional: followed by the string ” A.D.”
7. Followed by a literal close parenthesis

This article was last modified on July 19, 2013

Comments (0)

Loading comments...