GNOME Bugzilla – Bug 425542
Regexp does not work
Last modified: 2007-04-11 14:50:41 UTC
Please describe the problem: Using this regexp: <xsd:pattern value="([a-zA-Z0-9][a-zA-Z0-9\-_ ]{0,13})?[a-zA-Z0-9]"/> The value '49' is not accepted... 082-248200099-20070330-49-DE-1-1_0.xml:2: element Acte: Schemas validity error : Element '{http://www.interieur.gouv.fr/ACTES#v1.1-20040216}Acte', attribute '{http://www.interieur.gouv.fr/ACTES#v1.1-20040216}NumeroInterne': [facet 'pattern'] The value '49' is not accepted by the pattern '([a-zA-Z0-9][a-zA-Z0-9\-_ ]{0,13})?[a-zA-Z0-9]'. 082-248200099-20070330-49-DE-1-1_0.xml:2: element Acte: Schemas validity error : Element '{http://www.interieur.gouv.fr/ACTES#v1.1-20040216}Acte', attribute '{http://www.interieur.gouv.fr/ACTES#v1.1-20040216}NumeroInterne': '49' is not a valid value of the local atomic type. 082-248200099-20070330-49-DE-1-1_0.xml fails to validate Steps to reproduce: 1. 2. 3. Actual results: Expected results: Does this happen every time? YES Other information:
I agree there is a bug here. I believe that a reduced case demonstrating this is: [bill@bbsuper work]$ ./testRegexp -f bbtt1 Regexp: [8-9]{0,1}9 89: Ok 9: Fail Regexp: [1-2]{0,1}9 19: Ok 9: Ok i.e. the problem is a 'character class expression', followed by a 'quantifier range' which has a zero lower limit, followed by some atom, and the final atom is also a member of the character class. I'll try to isolate the bug within the library code (xmlregexp.c), but it may take some time (that code is rather complex and not easily understood).
I played around with this a bit, and discovered I could reduce the problem further: [bill@bbsf work]$ ./testRegexp -f bbtt2 Regexp: 9{0,1}9 99: Ok 9: Fail I made a small change to xmlregexp.c which seems to fix the problem. The fixed code is in SVN. Thanks for the report!