But in this case it was also not needed as I replied without actually
reading the requirements. 

-----Original Message-----
From: Paul Lalli [mailto:[EMAIL PROTECTED] 
Sent: 31 July 2007 14:21
To: beginners@perl.org
Subject: Re: String Manipulation

On Jul 31, 8:40 am, [EMAIL PROTECTED] (Dharshana Eswaran) wrote:
> And your suggestion worked. Thank you. But in the string which u had 
> suggested, [,\s*\/*]?, here \s* => tells spaces are optional,

No it doesn't.  The "dirty dozen" characters lose their special meaning
inside of a character class.

> /\* tells the beginning of the comment,

That's not what's in the pattern, and it wouldn't be correct even if it was.
The characters are \/*, not /\*.  The first is an escaped slash follwed by
an asterisk, the second is a slash followed by an
escaped asterisk.   The slash is still special because it's the regexp
delimiter, and so needs to be escaped.  Your changing it is a syntax error.

> I am unable to understand what these in a square bracket along with a 
> ? mean?

The square brackets are a character class.  Essentially, a list of options.
[,\s*\/*]?
means "0 or 1 of either a comma, a space, an asterisk, a slash, or an
asterisk".  Obviously, the two asterisks are redundant.

You should freshen up on regular expressions:
perldoc perlreref
perldoc perlretut
perldoc perlre

Paul Lalli


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



This e-mail is from the PA Group.  For more information, see
www.thepagroup.com.

This e-mail may contain confidential information.  Only the addressee is
permitted to read, copy, distribute or otherwise use this email or any
attachments.  If you have received it in error, please contact the sender
immediately.  Any opinion expressed in this e-mail is personal to the sender
and may not reflect the opinion of the PA Group.

Any e-mail reply to this address may be subject to interception or
monitoring for operational reasons or for lawful business practices.





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


Reply via email to