You are viewing a plain text version of this content. The canonical link for it is here.
Posted to regexp-dev@jakarta.apache.org by bu...@apache.org on 2007/01/04 03:13:24 UTC

DO NOT REPLY [Bug 41287] New: - Regular Expression problem

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41287>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41287

           Summary: Regular Expression problem
           Product: Regexp
           Version: unspecified
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P1
         Component: Other
        AssignedTo: regexp-dev@jakarta.apache.org
        ReportedBy: rochak.sethi@gmail.com
                CC: rochak.sethi@gmail.com


I have a typical problem that I have faced with the usage of Regular 
expression.
 

We are using the RegExp jar to perform UI data format validations. There are 
typically two number formats that we are supposed to be using 

First is the US format of 999,999,999.99 and the second is Italian number 
format of 999.999.999,99 . The difference between the two formats is swapped 
usage of a dot and a comma.


The regular expression that we are using for the US format is ^(\d{1,3}(,\d{3})
*)?(\.\d{1,2})?$

The regular expression that we are using for the Italian format is  ^(\d{1,3}
(.\d{3})*)?(\,\d{1,2})?$

Again swapped places of Dot and comma

Now when I pass 2.222.222 to the US format regular expression, it returns a 
false (which is expected )

But when I pass 2,222,222 to the Italian format regular expression, it returns 
a true and the validation passes( unexpected ). I would think that since the 
code base is the same for the �Match� method, it should behave the same but it 
does not. 

I ratified that it is not our code which is causing the issue by using this 
applet available on the Apache website . 
http://jakarta.apache.org/regexp/applet.html  

I hope I am not bothering you too much and any help on this will be greatly 
appreciated !

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: regexp-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: regexp-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 41287] - Regular Expression problem

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41287>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41287


vgritsenko@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |CLOSED




-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: regexp-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: regexp-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 41287] - Regular Expression problem

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41287>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41287





------- Additional Comments From bayard@apache.org  2007-01-04 09:16 -------
Looking at your regexp for the Italian version, it contains '.' and not '\.', so
anything will match there. ie:

^(\d{1,3}(.\d{3})*)?(\,\d{1,2})?$

to

^(\d{1,3}(\.\d{3})*)?(\,\d{1,2})?$

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: regexp-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: regexp-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 41287] - Regular Expression problem

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41287>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41287


rochak.sethi@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID




-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: regexp-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: regexp-dev-help@jakarta.apache.org