On Fri, 2004-09-24 at 11:01, Johnstone, Colin wrote: > Gidday all, > > Im trying to write a regex to convert spaces to underscores and ampersands to 'and' > can someone help. > > $safeString = "News & Events"; > $safeString =~ s/&/and/g; > $safeString =~ s/\s/_/g; > > Regards > > Colin >
What you have written is perfectly fine .. why do you think it will not work ? you may consider however writing '\&' instead of '&' Bye Ram -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>