Hi Folks,
I'm using the following code in a JUnit Test Suite. The Regexp
"^[^a-zA-Z0-9?&]?" is used to matche a couple of strings.
In assertEquals(....) I check, if the result of seperatorRegEx is false. As
far as I know either a "b", a "&" or a "?"
should match my regex.
Code:
RE seperatorRegEx = new RE( new
RECompiler().compile("^[^a-zA-Z0-9?&]?"));
assertTrue("seperatorRegEx fails", seperatorRegEx.match(","));
assertTrue("seperatorRegEx fails", seperatorRegEx.match("."));
assertTrue("seperatorRegEx fails", seperatorRegEx.match(";"));
assertTrue("seperatorRegEx fails", seperatorRegEx.match("-"));
assertTrue("seperatorRegEx fails", seperatorRegEx.match("*"));
assertTrue("seperatorRegEx fails", seperatorRegEx.match("'"));
assertTrue("seperatorRegEx fails", seperatorRegEx.match("#"));
assertTrue("seperatorRegEx fails", seperatorRegEx.match("~"));
assertEquals("seperatorRegEx fails on garbage", false,
seperatorRegEx.match("b")); <-- throws AssertionException (from JUnit)
assertEquals("seperatorRegEx fails on garbage", false,
seperatorRegEx.match("&")); <-- throws AssertionException (from JUnit)
assertEquals("seperatorRegEx fails on garbage", false,
seperatorRegEx.match("?")); <-- throws AssertionException (from JUnit)
I checked my regexp against a simple perl programm and the online-applet
form Apache-ORO package.
So what's wrong with my regexp?
Any ideas?
Thx
Toby
Mit freundlichen Gr��en
Best regards
Tobias Rademacher
----------------------------------------------------------------------------
------
Tobias Rademacher
Software Development
CEYONIQ Healthcare Fon: +49 (0)821 44490-0
GmbH & Co. KG Fax: +49 (0)821 44490-60
Kurzes Gel�nd 6 mailto:[EMAIL PROTECTED]
86156 Augsburg www.ceyoniq.com
Germany
----------------------------------------------------------------------------
-----------
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>