A Regular Expression for Stripping HTML Tags
Here's a regex I wrote yesterday for stripping specific html tags from a string:
<[^>]*(table|tr|td|th)[^<]*>
Here's an example in AS3 that removes <p> and <b> tags:
var testString:String = "<p><b>Hello</b> world!</p>";
var regEx:RegExp = new RegExp("<[^>]*(p|b)[^<]*>","gi")
trace(testString.replace(regEx,""));
Enjoy.
<[^>]*(table|tr|td|th)[^<]*>
Here's an example in AS3 that removes <p> and <b> tags:
var testString:String = "<p><b>Hello</b> world!</p>";
var regEx:RegExp = new RegExp("<[^>]*(p|b)[^<]*>","gi")
trace(testString.replace(regEx,""));
Enjoy.
8 Comments:
This comment has been removed by the author.
Hello
First of all, sorry to put irrelevant comment to this post. But I had installed SP1 on Bootcamp partition of my MAC and experienced exactly same thing tht you did (you posted about it in 2006)
I was searching for solutions on google and I came across your old post about similar situation. In the end you mentioned that you formatted the partition to get things right. How did you partition it? I can't find a way to do so, and I cant login to my leopard account now.
I had to do a complete wipe and reinstall from the OSX disc. Sorry you're having trouble, and I hope things improve.
This comment has been removed by a blog administrator.
ralph lauren poloburberry polo shirtthe north face jacketcolumbia jacketspyder jacketed hardy clothing ed hardy clothesed hardy shirts ed hardy t-shirts ed hardy sunglasses ed hardy mensed hardy womens Wholesale HandbagsCheap HandbagsWomens HandbagsCheap PursesDesigner HandbagsTennis RacquetTennis Racket
cheap tennis racquet
tennis racquet discount
cheap tennis racket
discount Tennis Rackethead junior tennis racketwilson tennis racquet
wilson tennis racket
head tennis racketbabolat tennis racket
Do not mean bad.Thank you so much!I just want to show some fashion things to all of you.I like ugg boots.black ugg boots,Loose T-shirt or super-size clothing are the best partners, it allows you to exercise in relax.The classic style cheap uggs may fit someone.You should never design yourself into a monster of no golden section point because beautiful cheap ugg boots.Also,for ladies, in winter sheepskin boots are the excellent choice.ugg boots on sale
Men's polo shirts was the shirt of choice for diverse groups of teenagers
Brightly coloured polo shirts can make you look like a Day-glo dirigible.
Wonderful!You can find the father who desire fashionable eg,uggs fashion,you can enjoy uggs online here, intellectual polo shirt simultaneously
God bless you!I really agree with your opinions.Also,there are some new fashion things here,gillette razor blades.gillette mach3 razor bladesfor men.As for ladies,gillette venus razor blades must the best gift for you in summer,gillette fusion blades are all the best choice for you.
Post a Comment
<< Home