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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

simple regex

Status
Not open for further replies.

vpalag

Programmer
Apr 28, 2002
11
IN
Hi,

My $body has some tags in the following fashion
<p>&nbsp;</p>

I am not able to clean them up by using
$body =~ s|<p>&nbsp;</p>||g;

Please help me if some one knows why it is not working.
Appreciate quick reply.

Pala

 
Actally I had &nbsp; in the $body....I could not see it in
my posting.

$body = 'blah blah <H1>SOME THING</H1> <p>ampnbsp</p>';

Please read amp as &.

Thanks,
Venu
 
You can use & to show a literal ampersand. That said, I don't know what the problem is... The following should work...

Code:
$body =~ s!<p>&ampnbsp</p>!!ig;
 
Thanks Krel, It's working. My mistake was I had a
$body =~ s|</p>|<br>|g before this - Venu


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top