GREP Question
Learn / Forums / InDesign User Groups / GREP Question
Tagged: GREP
- This topic has 1 reply, 2 voices, and was last updated 7 years ago by Aaron Troia.
-
AuthorPosts
-
-
February 24, 2017 at 12:34 pm #92390Christoph HuppertMember
Hey,
im often doing restaurant menus and there i have to add some characters to meals and ingredients which have to be set uppercase. And i want GREP to do that for me. But i dont get the right formula…
So for example: Normally the uppercase number oder letter is at the end of a word and can be 1 or 2 characters, which are separated by commas, they can be there one or more times. E.g. Can look like this: “Menu 1 with Coke1,7, Cheese1,2,A, Bacon2,3,10,L”. The problem is that my Grep code also set numbers in uppercase of the price “12,40€” Thats why i created following my Grep-Stil: (?<=[\l\u])\d+?\>(?!€) works with the first digit, but only for that one rest is untouched. I need one thats sets all uppercase number, letters and commas between uppercase but ignores the last comma, because this seperates it from the other ingriedents..
Sorry for my english, just a german guy trying to explain complicated stuff.. :D
-
April 6, 2017 at 9:28 am #93519Aaron TroiaParticipant
Hey Christoph,
I might not totally understand what you are trying to do, but it sounds like you only want to add styles to number following menu items, but not the price, your GREP is actually super close, try adding a comma to your positive lookbehind like this:
(?<=[\l\u,])\d+?\>(?!€)
I’ve tested this in InDesign with your example text and it only finds the menu item numbers and not the price on my end. Anyway let me know if that works or not on your end.
Aaron
-
-
AuthorPosts
- You must be logged in to reply to this topic.