Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4

Thread: strip html

  1. #1
    Senior Coder
    Join Date
    May 2004
    Posts
    1,466
    Thanks
    15
    Thanked 0 Times in 0 Posts

    strip html

    Is there anyway I can strip all html between the < > tags with one function? Maybe replacing just <br> or <li> with vbcrlf

    I don't want html that i have displayed to go into my database.

  • #2
    Regular Coder
    Join Date
    Apr 2005
    Location
    Lisbon, CT
    Posts
    339
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    Function RXreplace(rxPattern, myStr, repStr)
      Dim regEx
      Set regEx = New RegExp
      regEx.Pattern = rxPattern
      regEx.IgnoreCase = True	'optional
      RXreplace = regEx.Replace(myStr, repStr)
    End Function
    This function should be able to be used universally. However, as for the regex itself I am not well versed in that, so figuring out which pattern needs to be passed in will be up to you.

    BaldEagle

  • #3
    Senior Coder
    Join Date
    May 2004
    Posts
    1,466
    Thanks
    15
    Thanked 0 Times in 0 Posts
    hmm.. i don't know regexp either -- anyone out there that can help me edit this to just strip whatever is between html tags?

  • #4
    Senior Coder
    Join Date
    Nov 2002
    Location
    North-East, UK
    Posts
    1,265
    Thanks
    0
    Thanked 0 Times in 0 Posts


  •  

    Posting Permissions

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