I am struggling to learn GREP in InDesign and I purchased the book “GREP for InDesign” by Peter Kahrel. Every time I think I learn something, when I try it, it doesn’t work. I would like assistance with an expression I have been struggling with.
I typeset a lot of publications that list different months of the year followed by a date and I want to apply a “NO BREAK” character style to word spaces between the two. I would also like an expression that finds the months of the year even if they are abbreviated (I haven’t figured that out yet). Below is the expression I have been using, but I think it needs to be simplified for efficiency (with a marking subexpression?).
(?<=January) (?=\d)|(?<=February) (?=\d)|(?<=March) (?=\d)|(?<=April) (?=\d)|(?<=May) (?=\d)|(?<=June) (?=\d)|(?<=July) (?=\d)|(?<=August) (?=\d)|(?<=September) (?=\d)|(?<=October) (?=\d)|(?<=November) (?=\d)|(?<=December) (?=\d)
As you can tell, the basic structure I put together is using Positive Lookbehind for each month and Positive Lookahead for the digit. I have been using the vertical backslash (pipe) so it it will find one OR the next OR the next, and so on. The sequence repeats itself for each month and date. I came across an article that recommended limiting the number of parenenthesis in expressions. This might explain why some documents seem run slowly, but I am not sure.
Any assistance you can provide would be greatly appreciated. Thank you.