Thread: Regex and span
View Single Post
Old 01-19-2013, 08:12 PM   #5
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,803
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by JSWolf View Post
An example of what I'd like to do is to take the uppercase of fake smallcaps and convert it to lowercase. So in cases where they've multiple spans on the same line, being able to select each one is important.

<p>Just some text. <span class="SmallCaps">SOME SMALLCAP TEXT</span>. Some more text. <span class="SmallCaps">SOME MORE SMALLCAP TEXT</span>.</p>

Now I've seen stuff like this...

<p>Just some text. <span class="italic">S<span class="SmallCaps">OME</span> S<span class="SmallCaps">MALLCAP TEXT</span>.</span></p>

Can this be done?
Sure. (Having an example of the expected output for the shown input would help avoid confusion )

Code:
<span class="SmallCaps">(.+?)</span>
<span class="SmallCaps">\L\1</span>
theducks is offline   Reply With Quote