Hi!

what's problem in these regular expressions.. every thing correct!

do you need to convert one or more than one match into single replacement
then regexp should be

$safeString =~ s/\s+/_/g;




-----Original Message-----
From: Johnstone, Colin [mailto:[EMAIL PROTECTED]
Sent: Friday, September 24, 2004 11:02 AM
To: [EMAIL PROTECTED]
Subject: regex help


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


This E-Mail is intended only for the addressee. Its use is limited to that
intended by the author at the time and it is not to be distributed without
the
author's consent. Unless otherwise stated, the State of Queensland accepts
no
liability for the contents of this E-Mail except where subsequently
confirmed in
writing. The opinions expressed in this E-Mail are those of the author and
do
not necessarily represent the views of the State of Queensland. This E-Mail
is
confidential and may be subject to a claim of legal privilege.

If you have received this E-Mail in error, please notify the author and
delete this message immediately.


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to