TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 03-28-2008, 02:22 AM   #1 (permalink)
The Visitor
Newcomer 
 
Join Date: Mar 2008
Posts: 1
Thanks: 0
arcticfire is on a distinguished road
Default Need Regular Expressions Help

Hey all. First post. Anyway, I've been working on this for quite a while with two other people and we just can't figure it out.

We're trying to use regexp to remove the span tags from the following bit of html code. The outcome will be that users to our IPB forum will be able to turn off colors if they want.

Here is an example post.
HTML Code:
Regular text<br><br><!--coloro:#FF0000--><span style="color: rgb(255, 0, 0);"><!--/coloro-->Colored Text<!--colorc--></span><!--/colorc--> and more <!--coloro:#0000FF--><span style="color: rgb(0, 0, 255);"><!--/coloro-->Colored Text<!--colorc--></span><!--/colorc--><br><br>Some <img src="style_emoticons/default/laugh.gif" style="vertical-align: middle;" emoid=":lol:" alt="laugh.gif" border="0"> Cool  <img src="style_emoticons/default/wink.gif" style="vertical-align: middle;" emoid=";)" alt="wink.gif" border="0"> Smilies <img src="style_emoticons/default/unsure.gif" style="vertical-align: middle;" emoid=":unsure:" alt="unsure.gif" border="0"> <br><br><!--sizeo:6--><span style="font-size: 24pt; line-height: 100%;"><!--/sizeo-->Bigger<!--sizec--></span><!--/sizec--><br><br><!--fonto:Impact--><span style="font-family: Impact;"><!--/fonto-->Different<!--fontc--></span>
Using regular expressions, we hope to take the code off of this:
HTML Code:
<!--coloro:#FF0000--><span style="color: rgb(255, 0, 0);"><!--/coloro-->Colored Text<!--colorc--></span><!--/colorc--> and more <!--coloro:#0000FF--><span style="color: rgb(0, 0, 255);"><!--/coloro-->Colored Text<!--colorc--></span><!--/colorc-->
to make it this:
HTML Code:
Colored Text and more Colored text
Basically, we need the right regex to remove all between the <!--coloro:a.color.here--><!--/coloro--> and <!--colorc--><!--/colorc> tags.

Can anybody help?
arcticfire is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 01:31 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design