I like to use GREP in In-Design, the problem is I have a menu like so:
HAMBURGER Johnny's Favorite 3.50
I like Johnny's Favorite
to be styled differently.
The first part, the dish, may contain separate words like: SPICEY CHICKEN
. However the dish is always written in capitals.
So I thought:[^a-z]+ [A-Z][^A-Z]+ Favorite
.
Only now the dish is styled too. I am only interested in the favorite part, but it must begin with dish to validate. So I thought maybe I had to group it like so: [^a-z]+ ([A-Z][^A-Z]+ Favorite)
. But that didn't make any difference.
Any ideas?
[^a-z]+
as part of your search query, so that will be a part of what it finds and applies any changes to, regardless of whether you group it or not. You could use a lookbehind, but a lookbehind must have a calculable length, so you can’t use+
in it. You could do something like(?<=\u{3}\s)\u\l+ Favorite
, if you’re certain there will always be at least three uppercase letters at the end. Or you could add something unique after the dish name and use nested styles instead.