Welcome Guest, Not a member yet? Register   Sign In
Regular Expressions adding SPAN tag around words
#1

[eluser]yannyannyann[/eluser]
Hi there,

I'd like to automatically add span tags around each word of a paragraph that already contains HTML code.
I tried regular expressions, but I am not that good in that.
Could you give a hint of how to start with ?

Code:
<h2 class='test'>Hello</h2><p>Welcome, <b>Joe</b> , how are you?</p>

Final code i'd like to have :
Code:
<h2 class='test'><span>Hello</span></h2><p><span>Welcome</span> <b><span>Joe</span></b> , <span>how</span> <span>are</span> <span>you</span></p>

Thanks in advance


Messages In This Thread
Regular Expressions adding SPAN tag around words - by El Forum - 08-24-2010, 03:01 AM
Regular Expressions adding SPAN tag around words - by El Forum - 08-24-2010, 05:56 AM
Regular Expressions adding SPAN tag around words - by El Forum - 08-24-2010, 07:13 AM
Regular Expressions adding SPAN tag around words - by El Forum - 08-24-2010, 07:20 AM
Regular Expressions adding SPAN tag around words - by El Forum - 08-24-2010, 07:26 AM
Regular Expressions adding SPAN tag around words - by El Forum - 08-24-2010, 07:35 AM
Regular Expressions adding SPAN tag around words - by El Forum - 09-16-2010, 01:06 AM
Regular Expressions adding SPAN tag around words - by El Forum - 09-22-2010, 06:04 AM



Theme © iAndrew 2016 - Forum software by © MyBB