regular expression to replace \n with <br>

From: pat (wmrpbhhapzlm_at_spammotel.com)
Date: 10/20/04

  • Next message: cnrez: "Re: Accessing Live Currency Exchange Rates to Use with PHP"
    Date: 20 Oct 2004 09:44:38 -0700
    
    

    I want a Regular expression that replaces any new line with the HTML
    <br> tag, but only if and only if the new line does not already
    contain any tags (e.g. <tr>)
    The following won't do, as it will add a <br> tag to new lines which
    already have another HTML tag!
            objLineFeedRegExp = new RegExp("\n", "gi");
            strBody =
    strBody.replace(objLineFeedRegExp,"<br>")


  • Next message: cnrez: "Re: Accessing Live Currency Exchange Rates to Use with PHP"