Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

strip last closing </p>

Status
Not open for further replies.

lizok

Programmer
Jan 11, 2001
82
0
0
US
Hello. i need some help with stripping last closing </p> tag in the string.

i might have some text like this:
<p>this is paragpha 1</p>
<p>this is paragraph 2</p>

well i need to strip that very last </p> tag for paragraph2.

can you anyone help?

thanks
 
[tt] var rx=/<\/p>(?![\s\S]*?<\/p>[s\S]*$)/;
s=s.replace(rx,""); //some string s
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top