Quote:
Originally Posted by Tex2002ans
Smallcaps Unicode:
Search: (*UCP)([[:upper:]])([[:upper:]]{2,})
Replace: <span class="smallcaps">\1\L\2\E</span>
Definitely don't Replace All while using this one, as there can be many false positives.
What each part is doing, in plain English:
(*UCP) = This tells PCRE to be "unicode aware". Allows you to get those accented characters, like È.
[[:upper:]] = Grabs the first uppercase character. (Becomes Group 1)
[[:upper:]]{2,} = Grabs the next 2 or more uppercase characters. (Becomes Group 2)
.../...
|
The above regex works fine.
Maybe it's a little greedy because it also transforms words written in capitals which are included in the
head like "DOCTYPE".
Is there a way to make it work strictly within
body tags?