Copy link to clipboard
Copied
Hi all,
I'm really struggling to work this one out and I feel like I need a double lookbehind or something crazy. I need to assign a No Break to every instance of "Xxxx Plate". The names of the plates are somewhat abstract so I'm defining them as any word preceding the word "Plate" that has a capital letter in it. So it would No Break "Lovely Plate", "Sooper Plate" but not "our Plates" or "this particular Plate".
(?<=\<)\u seems to find the capital letter in the words, but I want the space after it, and only if that space is proceeded by the word Plate.
I'm lost, basically. I've been going round and round and can't work out a solution. Not even close, tbh.
Any help would be hugely appreciated.
Matt
\b\u[\w-]+\hPlate\b
(^/)
Copy link to clipboard
Copied
\b\u.+?\b\h\bPlate\b
Copy link to clipboard
Copied
\b\u[\w-]+\hPlate\b
(^/)
Copy link to clipboard
Copied
Ask I suspected, I was a million miles away. Thank you for your help, I'll deconstruct it so I know better next time.
Copy link to clipboard
Copied
Dare I ask to pick your brain again? My client has now added a two word plate title, so it reads Sooper Blue Plate. It's always capitalised, so I've been trying to adjust the GREP you gave me with a "Find any capitalised words together with Plate and don't break", but again I'm falling short. I get that we looking for a word boundary with a cap, with any white space before the word Plate, but I can't figure (again) how to make it more than one word before Plate.
If you're able to help again, could you possibly give me a hint as to what I'm missing. I'm desperately trying to learn GREP, but it's not my forte at the moment.
Copy link to clipboard
Copied
\b\u[\w-]{2,}\hPlate\b
(^/)
Copy link to clipboard
Copied
That doesn't Seem to help, sorry. I'm testing it with the sentence "Light Blue Plate with a Sooper Yellow Plate right next to a Soot Grey Plate and a Light Red Plate", but it still breaks the first capitalised instance. I really need it not break "Light Blue Plate" etc. Can I trouble you again? Thank you for your help so far.
Copy link to clipboard
Copied
Oups!
(\b\u[\w-]+\h){2,}Plate\b
(^/)
Copy link to clipboard
Copied
Amazing! Thank you thank you!