SitePoint Sponsor

User Tag List

Results 1 to 12 of 12

Threaded View

  1. #1
    SitePoint Member
    Join Date
    Sep 2006
    Location
    Currently Toronto, Canada.
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question regex: remove everything not div tags

    Hi,

    Searched but haven't found a solution to this.
    I want to remove everything from html code that is not a <div> or </div> tag (opening or closing).
    Since this matches the divs:
    Code:
    <div.*?>|</div>
    I thought I could just negate it somehow, such as:
    Code:
    [^(<div.*?>)]|[^(</div>)]
    (does not work)

    Any ideas?
    Cheers
    Last edited by pog; Jul 20, 2010 at 15:48. Reason: pasted wrong code


Tags for this Thread

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
  •