I'm not a regex guru, but I think this search/replace should at least insert the italics tag around capital letters (I don't know how to convert upper to lower case, however - perhaps set up a css lower case class for your italics tag if there's no other way?)
Search (case sensitive) for: ([ >“‘])([^a-z]+)([ <”’])
Replace: \1<i>\2</i>\3.
It will search for a block of text which contains at least two characters, and no lower case (but punctuation and numbers are okay) book-ended by either spaces, open/close tag signs, or quotation marks, an then insert the <i></i> around the text.
If you know you're only searching for caps, with no numbers or punctuation, then replace the text search term to [A-Z]+
Hope this helps.
Cheers, Carl.
|