Thread: Regex and span
View Single Post
Old 01-20-2013, 07:01 AM   #6
Perkin
Guru
Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.
 
Perkin's Avatar
 
Posts: 655
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin)
Expanding on theducks answer, to combine the Spans in second example, you could use
Code:
<span class="SmallCaps">(.+?)</span>([\sA-Z]*)<span class="SmallCaps">(.+?)</span>
and replace with
Code:
<span class="SmallCaps">\L\1\E\2\L\3</span>
BEWARE
The trouble using these sorts of regex is when they contain a name or word which has a uppercase letter inside, which would then get converted to lowercase.

Last edited by Perkin; 01-20-2013 at 07:08 AM.
Perkin is offline   Reply With Quote