[EMAIL PROTECTED] пишет:
Because I want comma (,) exactly once

-----Original Message-----
From: Vyacheslav Karamov [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 14, 2008 4:41 PM
To: Sayed, Irfan (Cognizant)
Cc: [EMAIL PROTECTED]; beginners@perl.org
Subject: Re: Regarding reg. exp.

[EMAIL PROTECTED] пишет:
if ($trig_np =~ m/\d,{1}\d|\d\s{1}\d/)

this what I did.

Hi!

Why have you used {1} quantifier?

No, its not correct. if you mention for example \d this will match *single* digit.
Your regex will match 1,2 or 1 2, but *not*  12,2 or  234323  53

if ($trig_np =~ m/ \d+ [,\s] \d* /x)

is much more correct




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


Reply via email to