Regular expression

Discussion in 'Programming' started by CerIs, Sep 29, 2007.

  1. #1
    Hi, im very new to regular expressions so this might be a stupid question :) So what im trying to do is remove a line of html, in this case a span tag with all the content inside it and the ending <\span>. I can get it to find the start of the tag ok but the thing is i dont know how to reference the data inside it as it could be any type (numeric/alpha/punt) etc and any length. Something like [[:alnum:]]+ ? Thanks for your help.

    <cfsavecontent variable="content">
    <cfoutput>
    <span class="style">text and £$^$%^$ Data )() dfg56456456 45654</span>
    </cfoutput>
    </cfsavecontent>

    <cfset content2 = REReplaceNoCase(content,'\<span class\=\"style\"\>','','all')>
     
    CerIs, Sep 29, 2007 IP
  2. Jamie18

    Jamie18 Peon

    Messages:
    201
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    something like

    rereplacenocase(content,"\<span\.*\\span\>","")
     
    Jamie18, Oct 1, 2007 IP