View Single Post
Old 03-10-2013, 03:32 AM   #2
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
You could do something along these lines:

Search:

Code:
([A-Z][A-Z,"\. ]+ [A-Z]{2,})
Replace with:

Code:
<span class="incaps">\1</span>
The Red section of the Regex will grab the first capital letter, followed by all caps, commas, quotations, and periods.

The Blue section will always be looking for a space followed by two more capitals, and will fail when it does NOT see "a space and 2 or more capitals in a row".

This will match:

Code:
<p>"AAAAAA BBBBBB CCCCCC, DDDDD EEEEE," he said, FFFFF GGGGG HHHHH. Zzzzzz yyyyy xxxxx.</p>
Tex2002ans is offline   Reply With Quote