This is driving me crazy, I have a string in the format:
<br />
twice<br />
imap Test wrote:<div class="nestedMessage1"><br />
> nested<br />
><br />
> imap@gazler.com wrote:<div class="nestedMessage2"><br />
>> test<br />
>><br />
>> -- <br />
>> Message sent via AHEM.<br />
>> </div><br />
><br /><br /></div>
And the following code:
string = string.replace(/\n/g, "");
string = replaceAll(string, "<br />>", "<br />");
function replaceAll(string, replaceString, replaceWith)
{
return string.replace(new RegExp(replaceString, 'g'),replaceWith);
}
What I am attempting to do is remove the <br />> and replace it with just the <br /> I can't simply replace all occurrences of > as they may be contained elsewhere in the line, so I only want to remove them at the start. I have tried escape characters and have hardcoded the regular expression to remove the new lines explicitly instead of including them in the function call. Any help would be appreciated.
>> not just
> – Jason Rowe Jan 26 '10 at 00:11