Skip Menu |

This queue is for tickets about the Regexp-Common CPAN distribution.

Report information
The Basics
Id: 61712
Status: resolved
Priority: 0/
Queue: Regexp-Common

People
Owner: Nobody in particular
Requestors: paul.a.liebert [...] hp.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 2010010201
Fixed in: (no value)



Subject: '.' is recognized as a number by $RE{num}{real}
perl -MRegexp::Common -e 'my($n)= "A period . is not a number like 0.47" =~ /($RE{num}{real})/; print "Got $n\n";' Got . The RE{num}{real} finds that a stand-alone period is sufficient to constitute a number. I believe that a digit must be adjacent to at least one side of a period to qualify as a number. The current REX is (?:(?i)(?:[+-]?)(?:(?=[0123456789]|[.])(?:[0123456789]*)(?:(?:[.])(?:[0123456789]{0,}))?)(?:(?:[E])(?:(?:[+-]?)(?:[0123456789]+))|)) I believe this fixes the problem (?:(?i)(?:[+-]?)(?:[0123456789]+(?:[.][0123456789]*)?|[.][0123456789]+)(?:(?:[E])(?:(?:[+-]?)(?:[0123456789]+))|))
Fixed in version 2011041601.