p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Perl (http://p2p.wrox.com/forumdisplay.php?f=196)
-   -   not able to add forward slash in regex (http://p2p.wrox.com/showthread.php?t=71897)

eruditionist December 18th, 2008 05:52 PM

not able to add forward slash in regex
I have a requirement where <br> needs to be replaced with <br/> so I am doing this in my regex

$htmlstring =~ s/br>/br/>/;

This is not working and I am sure I am doing this wrong. Could someone tell me wha tthe syntax is please?


eruditionist December 18th, 2008 07:05 PM

I got it thanks

ciderpunx May 14th, 2009 10:15 AM

FFR you need to escape the slash thus:

$htmlstring =~ s/br>/br\/>/;

All times are GMT -4. The time now is 08:45 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.