Regex Works on Oro Test Applet but doesn't work in code using oro 2.08
"Keast Ann" <[email protected]> Tue, 5 Apr 2005 12:17:44 -0400
| Newsgroups | gmane.comp.jakarta.oro.user |
|---|---|
| Message-ID | <2EB6297382462046A9427D7324788A48056E80@MCLNEXVS06.resource.ds.bah.com> |
------_=_NextPart_001_01C539FB.0C936477
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I am using jarkarta-oro-2.0.8 to do some input validation.
=20
I have a simple method:=20
=20
import org.apache.oro.text.perl.Perl5Util;
public static boolean matchRegexp(String value, String regexp) {
if (regexp =3D=3D null || regexp.length() <=3D 0) {
return false;
}
=20
Perl5Util matcher =3D new Perl5Util();
return matcher.match("/" + regexp + "/", value);
}
=20
And it works fine in all cases with the regexp =3D =
(\\d{0,2})(\\.)(\\d{0,4}) except for when
value =3D 0.11000000000000000055511151231257827021181583404541015625
=20
I expected this value to fail because it's greater than 4 digits after =
the decimal point. But it actually passes! =20
=20
It works on the applet at: http://jakarta.apache.org/oro/demo.html ( =
using: (\d{0,2})(\.)(\d{0,4}) ) but it doesn't work in my code using =
jarkarta-oro-2.0.8.
=20
Any ideas on why this is occuring?
=20
Thanks,
Ann
------_=_NextPart_001_01C539FB.0C936477--