SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Regex Pattern

  1. #1
    SitePoint Enthusiast wavman's Avatar
    Join Date
    Jul 2002
    Location
    Isle of Wight
    Posts
    59
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Regex Pattern

    Hi,

    bit of a newbie to rexep stuff. am trying to get search results from the static contents of asp pages. Using the pattern <[^>]*> I get the html tags ignored in the results and I was assuming something like <%[^%]*%> would get anything within asp tags also removed.

    However I get an unterminated string constant error when using the second pattern. Any idea how to get this to work?

    Function RemoveHTML( strText )
    Dim RegEx
    Set RegEx = New RegExp
    RegEx.Pattern = "<[^>]*>"
    RegEx.Global = True
    strText = Replace(strText, "<br>", chr(10))
    text = RegEx.Replace(strText, "")
    End Function

    Is what i have currenly and I would like to create a RemoveASP version of it as well.

    Thanks

  2. #2
    SitePoint Enthusiast wavman's Avatar
    Join Date
    Jul 2002
    Location
    Isle of Wight
    Posts
    59
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Any ideas? Still can't make it work!

  3. #3
    ALT.NET - because we need it silver trophybronze trophy dhtmlgod's Avatar
    Join Date
    Jul 2001
    Location
    Scotland
    Posts
    4,836
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    When I developed ASP apps full time, nothing made me cry more than doing RegExp with ASP! This might help: http://www.codeproject.com/asp/removehtml.asp


Bookmarks

Posting Permissions

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