SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot Mr. Ram's Avatar
    Join Date
    Nov 2005
    Posts
    139
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)

    Thumbs up Regular Expression to remove all links inside the specific <body> tag

    I need a regular expression to remove all the links inside the specific <body> tag.
    Ex Input:
    <body>
    <a href="url">Link text</a>
    <a href="url">Link text</a>
    </body>
    <body2>
    <a href="url">Link text</a>
    <a href="url">Link text</a>
    </body2>

    Ex Output:
    <body>
    Link 1 text
    Link 2 text
    </body>
    <body2>
    <a href="url">Link text</a>
    <a href="url">Link text</a>
    </body2>

    Pls provide your inputs in this.

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,527
    Mentioned
    84 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by Mr. Ram View Post
    I need a regular expression to remove all the links inside the specific <body> tag.
    That may not be so easy to achieve with just a regular expression.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


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
  •