Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Open Source > Perl
|
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Perl section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 18th, 2008, 05:52 PM
Authorized User
 
Join Date: Sep 2008
Posts: 56
Thanks: 0
Thanked 1 Time in 1 Post
Default 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?

thanks.
 
Old December 18th, 2008, 07:05 PM
Authorized User
 
Join Date: Sep 2008
Posts: 56
Thanks: 0
Thanked 1 Time in 1 Post
Default

I got it thanks
 
Old May 14th, 2009, 10:15 AM
Friend of Wrox
 
Join Date: Dec 2003
Posts: 488
Thanks: 0
Thanked 3 Times in 3 Posts
Default

FFR you need to escape the slash thus:

$htmlstring =~ s/br>/br\/>/;
__________________
--
Charlie Harvey's website - linux, perl, java, anarchism and punk rock: http://charlieharvey.org.uk





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Escape Forward Slash in XPath/ XSLT? tclancy XSLT 4 January 10th, 2006 05:28 PM
Forward after Login ~Bean~ ASP.NET 1.0 and 1.1 Basics 1 July 14th, 2005 05:14 PM
Forward booking rahilahmed Pro VB Databases 1 June 16th, 2004 06:02 PM
Forward Booking rahilahmed Excel VBA 0 May 24th, 2004 09:25 AM
Slash Sign "\" in Server Name??? omermalik BOOK: ASP.NET Website Programming Problem-Design-Solution 1 October 10th, 2003 05:14 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.