This queue is for tickets about the IO-Prompt CPAN distribution.

Report information
The Basics
Id:
18652
Status:
open
Priority:
Low/Low
Queue:

People
Owner:
Nobody in particular
Requestors:
Smylers [...] stripey.com
Cc:
AdminCc:

BugTracker
Severity:
(no value)
Broken in:
(no value)
Fixed in:
(no value)



Subject: -integer Permits 1e-3
Date: Tue, 11 Apr 2006 13:42:35 +0100
To: bug-io-prompt@rt.cpan.org
From: Smylers <Smylers@stripey.com>
Hi again. I've spotted another tiny bug in IO::Prompt. The pattern for matching integers (line 81 in version 0.99.4) permits negative exponents, so allows through numbers such as 1e-3, which is of course 0.001 and not an integer. I think that the problem can be fixed by changing the pattern from: qr{[+-]? \d+ (?:[Ee][+-]?\d+ )?}x, to: qr{[+-]? \d+ (?:[Ee]+?\d+ )?}x, Though I hear that for patterns for standard things like integers the module Regexp::Common is available; I think I saw it recommended in some book with a dog on the cover ... Smylers
Subject: Re: [rt.cpan.org #18652] -integer Permits 1e-3
Date: Wed, 12 Apr 2006 06:07:39 +1000
To: bug-IO-Prompt@rt.cpan.org
From: Damian Conway <damian@conway.org>
Show quoted text
> I think that the problem can be fixed by changing the pattern from: > > qr{[+-]? \d+ (?:[Ee][+-]?\d+ )?}x, > > to: > > qr{[+-]? \d+ (?:[Ee]+?\d+ )?}x,
It is indeed. And has been. Many thanks.
Show quoted text
> Though I hear that for patterns for standard things like integers the > module Regexp::Common is available; I think I saw it recommended in some > book with a dog on the cover ...
"Do as I say, not as I do!" ;-) Damian


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.