Jonware or Peter K will have more to say about whether this is a good idea, but I don't see an inherent problem other than a potentially big performance hit.
That said, these are all capitalized words that don't start a paragraph. Do your paragaphs have more than one sentence? If not, would there ever be a Capitalized word not starting the paragraph thar you would NOT want to match? If not, perhaps the simpler ^\w+\s\u\l+ would work.
I don't think there's any functional difference between ^(\w+)(\w+) and just \w+ but you might need to include the \s\w+$ at the end if you want to limit the match to three word paragraphs. Maybe you meant ^(\w+)\s(\w+) to pick up the third word in a four-word paragraph?
You probably need to add spame parnethesese to my expression if you are trying to rearrange or susbstitute the individual words, but as your query is structured it cannot apply a style to just those listed words, but will apply any formatting to the entire match.
Boy, I really can't type this morning. Let's try again:
You probably need to add some parentheses to my expression if you are trying to rearrange or substitute the individual words, but as your query is structured it cannot apply a style to just those listed words, but will apply any formatting to the entire match.
Yes, Peter, the idea is to detect the order of the words.
My Greps sound a little bizarre but is working...
1 person found this helpful
It would probably help if you tell us what you are trying to do in detail.
As I mentioned, with no space between those first two (\w+) groups, they find only the first word, so this may not be working as well as you think, or possibly it's just a typo in what you entered here.
!!!Yes, it was a typo.
The queries for this book are working very good.
Only one, the posted here, seems just a little terrible programmed.
But it is working.
I posted looking for other methods, instead of the alternative tool
Since I don't know exactly what you expect to do with the GREP, I can't offer another method (or even an alternative GREP expression that would be less cumbersome).
And I'm not clear, I'm afraid, on what the difference is between another method and an alternative tool.
Thank you. For the moment the query is working very good.