Copy link to clipboard
Copied
Hi all. Please can anyone help with a GREP query? At the moment I want my sentences to have every word capitalised - but it's also putting the S after all apostrophe's in capitals ie '
The World’S First double flowered Polyanthus'
my GREP is:
\b[\u\l]
and the character style being applied is a simple Uppercase style.
Please can the above be amended to somehow avoid doing this after a hyphen?
Also how could I list specific words to be excluded? Ie the, or, is etc.
Thanks in advance!
If you need to restrict this to only certain paragraph styles, I bet it's a pretty easy script for the scripting guys, and you could assign a keyboard shortcut to it.
Copy link to clipboard
Copied
Are you wanting to do this in a GREP style or as a Find/Change? (Change case to title case will capitals on each word.)
In your example why not Captal D and Capital F?
Sometimes easier to do two simple things than solve in one search /GREP style.
The second one you want is a "positive lookbehind apostraphy s"
(?<=')s
Copy link to clipboard
Copied
Thanks Lukas. In my example although the 'd' and 'f' are lowercase when copy-pasted here, they're capitalised in my document where the GREP changes them.
Copy link to clipboard
Copied
Please excuse my ignorance Lukas but how can I add further examples to the same GREP please? For example this one is perfect or who's or what's etc but how about words that end 'll or 'd etc? I seem to recall examples can be listed with the | between them? Thank you again Lukas.
Copy link to clipboard
Copied
changing the "s" in the above expression to \w+ would probably catch all possible cases, but I'm curious why simply setting Title Case as part of the style for the paragraph isn't the easier option?
Title Case capitalizes every word no matter how it's keyed and the usual question we get for it is how to prevent it from capitalizing certain short words like and or of.
Copy link to clipboard
Copied
Peter, as far as I've always been aware, Title Case is not an option with the paragraph style itself? Just small caps or all caps.
Copy link to clipboard
Copied
Son of a gun, you're right. No way to apply title case except through using the Change Case command on selected text. Seems like that ought to be an available setting...
SO...
Why not set your text, the select all and Change Case?
Copy link to clipboard
Copied
If you need to restrict this to only certain paragraph styles, I bet it's a pretty easy script for the scripting guys, and you could assign a keyboard shortcut to it.
Copy link to clipboard
Copied
Thanks for the help Peter. Yes this would be a handy option to have within the styles.
Copy link to clipboard
Copied
The following grep style should work for all words with more than 2 letters. (Unfortunately, you did not specify the exceptions).
\<\l(?=\l{2,})