Thread: Paragraphs tags

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2016
    Posts
    7
    Rep Power
    0

    Paragraphs tags


    Hello All,

    I have a problem where I like to clean the extra paragraphs the one inside where is an opening space and the closing paragraph
    The below code deletes all. How can i just delete <p> </p> ?
    Code:
    </p><p> </p><p>
    <\/?p[^>]*>
    Thank you for your help

  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2016
    Posts
    7
    Rep Power
    0
    this one works
    Code:
    <p[^>]*>[\s|&nbsp;]*<\/p>
  4. #3
  5. Wiser? Not exactly.
    Devshed God 2nd Plane (6000 - 6499 posts)

    Join Date
    May 2001
    Location
    Bonita Springs, FL
    Posts
    6,079
    Rep Power
    4101
    That should be
    Code:
    <p[^>]*>(\s|&nbsp;)*<\/p>
    Using brackets rather than parenthesis means it would also match something like
    Code:
    <p>ns</p>

    Comments on this post

    • mp5163093 agrees
    Recycle your old CD's



    If I helped you out, show some love with some reputation, or tip with Bitcoins to 1N645HfYf63UbcvxajLKiSKpYHAq2Zxud

IMN logo majestic logo threadwatch logo seochat tools logo