Skip to main content
Participant
August 6, 2022
Answered

Grep expression to change font style of Armenian characters only

  • August 6, 2022
  • 2 replies
  • 610 views

So I have several Armenian documents that I'm working with that have interspersed English portions which show up with missing fonts. Is there an expression that will change only the English portions to a different Character Style?

This topic has been closed for replies.
Correct answer Joel Cherney

Joel is better versed in this, but it sounds like a combination of using the world-ready composer and having a reight to left language applied.


So Reuben, are you using the Middle East edition of InDesign? If so, there are tools to control whether the addresses and phone numbers render right-to-left or left-to-right. 

 

If you're not using the Middle East edition, then I am starting to believe that there is a bug introduced in a recent version of ID where people using non-Latin scripts are experiencing RTL behavior being turned on "under the hood" when they have no tools in the interface to turn it off. But if you are using an ME edition of InDesign, you can do a Find/Change operation where you change all numbers and dashes and parentheses to Left-to-Right Direction and US English language, which should fix it for you. 

2 replies

Joel Cherney
Community Expert
Community Expert
August 6, 2022

Alireza's response is close, but it misses all capital letters. If you only needed A through Z and a through z, you could do something along these lines:

 

[a-z|A-Z]+

That's "one or more characters between a and z, or one or more characters between A and Z."

 

You say "English portions" in your post, but I couldn't tell you if that included numerals, punctuation, and so on.  The following GREP query finds everything in Latin script, as well as generic Latin script punctuation:

 

[\x{0021}-\x{0100}]+

 

The \x{####} marks a Unicode value. So you can look at Unicode tables (or the Type -> Glyphs menu within InDesign) and replace the #### with the hex values for the range you want to look for. 

 

If you want to get everything in the Latin-script range, but e.g. you want to exclude the comma and the colon, you can specify multiple ranges by doing something like this

 

[\x{####}-\x{####}|\x{####}-\x{####}]+

 

The vertical pipe | is "or" in GREP, so you the above expression is "anything between ___ and ___, or anything between ____ and _____". 

 

 

MBI_MediaAuthor
Participant
August 8, 2022

Thank you all for your responses, they've been a great help. @Joel Cherney , your expression worked perfectly, thank you so much. I just wish I knew how you all found those expressions. I was using InDesigns Wildcards, but they appeared to be limiting regarding what I was attempting to acheive. Is there somewhere I can learn to use expressions as you do?

Peter Spier
Community Expert
Community Expert
August 8, 2022

Possibly the best resource on the planet for GREP in InDesign: Now available: GREP in InDesign, 3rd Edition | CreativePro Network 

Participating Frequently
August 6, 2022

Hi ReubenG1977;

You can search [a-z] to find all English texts and change their styles.

 

Robert at ID-Tasker
Legend
August 6, 2022

But it will work ONLY in cases when no ASCII characters are used.