After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 425542 - Regexp does not work
Regexp does not work
Status: RESOLVED FIXED
Product: libxml2
Classification: Platform
Component: general
2.6.27
Other All
: Normal major
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2007-04-02 17:05 UTC by Clement Moulin
Modified: 2007-04-11 14:50 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Clement Moulin 2007-04-02 17:05:19 UTC
Please describe the problem:
Using this regexp:
<xsd:pattern value="([a-zA-Z0-9][a-zA-Z0-9\-_&#x20;]{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:
Comment 1 William M. Brack 2007-04-10 14:50:49 UTC
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).
Comment 2 William M. Brack 2007-04-11 14:50:41 UTC
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!