I'm working on a long document. There are lots of paragraphs which start with first word ALL CAPS. So I want to apply a paragraph style to all those paragraphs at once. So the problem is, I want to find and replace only the paragraphs which first word is ALL CAPS. Then I can apply the paragraph style to it. Anyone can help to find a Grep for this?
Attached a screenshot to get things clear. Please tell me if I didn't explained it clearly.
It makes a difference if the All Caps were keyed that way with the shift lock on or if they were applied to lowercase letters.
So, if the text at the beginning of a paragraph was typed using actual uppercase letters, use a GREP search for:
If the type is upper and lowercase, but formatted with the All Caps command use a Text search for text formatted as All Caps:
You still need to be sure you're finding text at the start of the paragraph, though, and that first letter would have been typed as upper case and may or may not have all caps applied.
(?<=^\u)\l seems to find the string correctly up until I add the All Caps formatting at which point I get a Cannot find match error because the first letter is not styled as All Caps.
I suspect that if the first character in the paragraph is plain typed upper case and not styled as All Caps it is not possible to find the first word in the paragraph in all caps using Find/Change. I'd love it if one of the GREP ninjas could tell me I'm wrong and show us how it's done.
I don't write scripts, but I have every confidence that this could be scripted by checking the second character in a paragraph to see if All Caps is applied and if is true assign the paragraph style.
Seen as you can't do a find change to change things to UPPERCASE as with the Type>Change Case
It would be beneficial first to go the route of finding the uppercase at the beginning of a line
And changing this to All Caps
Then you can do the find change to find all the All Caps at beginning of a sentence
That's a good idea.