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/


Reply via email to