Removing unwanted html tags

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default Removing unwanted HTML tags

    Guys I have a list of links that I have parsed using regexp. However when I
    output them, some of them have html tags still attached as well as the HREF.
    Im currently using a regex from a CF book to remove the tags but it doesnt
    work. The regex is '<[^>]*>', '', 'ALL')> Here is an example of the links I
    output: <td><a href='http://www.rspb.org.uk:80/vacancies/?id=3440305'> Any
    help with this is greatly appreciated.

    samb1 Guest

  2. Similar Questions and Discussions

    1. Unwanted margin tags
      A client of mine has been cut/pasting text into Dreamweaver templates I've built using Contribute. The text comes in with additional "margin" tags...
    2. [PHP] comparing xml files, removing some html tags
      Hi, Discussion of xerces will take us out of the mandate of this list. Please download xerces from http://xml.apache.org along with the documents...
    3. comparing xml files, removing some html tags
      Hi, I need to compare two XML files in order to find if they are "similar", i.e their DOM tree have the same structure. The ideia is to use...
    4. Removing Unwanted Download
      I inadvertently downloaded a program that installed itself in a program folder called eZula. I'm running Windows XP Home SP 1. The program...
    5. Removing Unwanted Objects
      I've got a picture of the "teacups" at Disneyworld. The person I want is in the background, and an unwanted person is in the foreground (Not...
  3. #2

    Default Re: Removing unwanted HTML tags

    Guys
    Im still struggling with this if any one has any ideas. Thanks
    samb1 Guest

  4. #3

    Default Removing unwanted html tags

    Guys I have parsed three different websites for job links. Ive then placed the
    links into an array but when I output the array I can see that the links have
    html tags around them. I need to remove the tags so that I can perform cfhttp
    requests on the links. Here is the code Im using: <!---HTTP Call each site
    index attribute from the XML---> <cfhttp method='get'
    URL='#Trim(xmlObj.xmlRoot.site.xmlAttributes.index )#'
    ResolveURL='yes'></cfhttp> <cfset StartPos = 1> <cfloop condition
    ='True'> <!---Parse the site index pages for job links---> <cfset
    Match = REFindNoCase(#Trim(xmlObj.xmlRoot.site.parse.xmlAt tributes.re)#,
    cfhttp.FileContent, StartPos, True)> <cfif Match.pos[1] EQ 0>
    <cfbreak> <cfelse> <cfset StartPos = Match.pos[1] +
    Match.len[1]> <!---<cfset Foundlinks = Mid(cfhttp.FileContent,
    Match.pos[1], Match.len[1])>---> <cfset StripLinks =
    #REReplace(#Mid(cfhttp.FileContent, Match.pos[1], Match.len[1])#,'<[^>]*>', '',
    'ALL')#> <!---Store the list of FoundLinks into the Links Array--->
    <cfset LinksArray= ListToArray(StripLinks)> <cfset counter = 1>
    <cfdump var='#LinksArray#'> </cfif> </cfloop> Any ideas
    greatly appreciated as im banging my head against another wall.

    samb1 Guest

  5. #4

    Default Re: Removing unwanted HTML tags

    I close to throwing myself from a top floor window (bit of an exageration) with this one. Thanks
    samb1 Guest

  6. #5

    Default Re: Removing unwanted HTML tags

    I've always used this function I wrote. This always works for me.

    function StripTags(string) {
    pattern = '<[^>]*>';
    return REReplaceNoCase(#string#, #pattern#, '' , 'ALL');
    }
    thejuggler Guest

  7. #6

    Default Removing unwanted html tags

    How would you modify the regex to remove all html tags except <b></b>
    Mike Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139