Regular expression "Replace <p> and </p>

Posted on 2005-05-13
Last Modified: 2013-12-24

How can I replace  <P and whatever text MS word puts here> with "" (nothing)
How can I replace </P> with "<br><br>" with Regular expression?

Regards, Fern
Question by:Fern2
    LVL 9

    Expert Comment

    Try this;

    <CFSET Content = REReplaceNoCase(Content, "<p([^>]*)>", "<br><br>", "ALL")>


    LVL 9

    Accepted Solution

    Sorry, didn't read it all the way. Try this:

    <CFSET Content = REReplaceNoCase(Content, "<p([^>]*)>", "<p>", "ALL")>
    <CFSET Content = REReplaceNoCase(Content, "</p>", "<br><br>", "ALL")>

    Or, you could change both <p> and </p> to <br><br> with:

    <CFSET Content = REReplaceNoCase(Content, "</?p([^>]*)>", "<br><br>", "ALL")>

    LVL 1

    Author Comment

    Thx a million

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
    If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now