Skip to main content

Bug Tracker

Side navigation

#3251 closed bug (invalid)

Opened August 13, 2008 07:09PM UTC

Closed February 05, 2010 08:35PM UTC

[validate] .1 is considered an invalid number

Reported by: xyrka Owned by: joern
Priority: minor Milestone: 1.3
Component: plugin Version: 1.2.6
Keywords: validate Cc:
Blocked by: Blocking:
Description

A number such as .1 or anything that is .(number) comes up as invalid if the number rule is used.

Here is the regex currently used:

/^-?(?:\\d+|\\d{1,3}(?:,\\d{3})+)(?:\\.\\d+)?$/

My modified one(probably could be more elegant):

/(^-?(?:\\d+|\\d{1,3}(?:,\\d{3})+)(?:\\.\\d+)?$)|(^-?\\.\\d+$)/

Attachments (0)
Change History (3)

Changed August 13, 2008 07:15PM UTC by xyrka comment:1

Woops didn't wrap my fix in a code block:

Current:

/^-?(?:\\d+|\\d{1,3}(?:,\\d{3})+)(?:\\.\\d+)?$/

My fix:

/(^-?(?:\\d+|\\d{1,3}(?:,\\d{3})+)(?:\\.\\d+)?$)|(^-?\\.\\d+$)/

Changed October 13, 2009 12:20AM UTC by dmethvin comment:2

owner: → joern

Changed February 05, 2010 08:35PM UTC by john comment:3

resolution: → invalid
status: newclosed

Please file plugin bugs with the appropriate author on their bug tracker.