Dr.Ruud wrote:
> Rob Dixon schreef:
> 
>> my $re = qr/^
>>   \d+
>>   (?:
>>    (?:,\d+)* | (?: \d+)*
>>   )
>> $/x;
>>
>> chomp (my $input = <>);
>>
>> if ($input =~ $re) {
>>   print "ok\n";
>> }
>> else {
>>   print "invalid\n";
>> }
> 
> One problem: the space in "(?: \d+)*" is eaten by the x-modifier.
> 
> I would normally use [[:blank:]], but in this case probably "\ " or
> "[ ]".

Thank you Ruud. I prefer the latter, but it's tempting to

  use charnames ':full';

and then use "\N{SPACE}" just to make the character visible.

Rob



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


Reply via email to