dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #22174
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10638: Minor adjustment to regex
------------------------------------------------------------
revno: 10638
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2013-04-19 16:12:51 +0200
message:
Minor adjustment to regex
modified:
dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/MathUtils.java
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/MathUtils.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/MathUtils.java 2013-04-19 13:52:46 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/MathUtils.java 2013-04-19 14:12:51 +0000
@@ -47,7 +47,7 @@
private static final double TOLERANCE = 0.01;
- private static final Pattern NUMERIC_PATTERN = Pattern.compile( "^-?(0|[1-9]\\d*)(\\.\\d+)?$" );
+ private static final Pattern NUMERIC_PATTERN = Pattern.compile( "^(0|-?[1-9]\\d*)(\\.\\d+)?$" );
/**
* Validates whether an expression is true or false.
=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js 2013-04-19 13:42:19 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js 2013-04-19 14:12:51 +0000
@@ -1631,7 +1631,7 @@
*/
function isNumber( value )
{
- var regex = /^-?(0|[1-9]\d*)(\.\d+)?$/;
+ var regex = /^(0|-?[1-9]\d*)(\.\d+)?$/;
return regex.test( value );
}