Oct 23, 2008 #1 lizok Programmer Jan 11, 2001 82 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
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
Oct 23, 2008 #2 tsuji Technical User Jul 25, 2001 10,675 US [tt] var rx=/<\/p>(?![\s\S]*?<\/p>[s\S]*$)/; s=s.replace(rx,""); //some string s [/tt] Upvote 0 Downvote