Re: [xml] Additional regexp test files



On Tue, Apr 19, 2016 at 05:24:00PM +0100, Pete Cordell wrote:
I've tried to reduce the patterns that I reported earlier to a minimal form.
For the timestamp pattern I've ended up with:

=>ab?c{0,1}
#fails
a
#ok
ab
abc
ac

  Ok that's something I need to look at and fix, bugs in the regexp code
aren't the most trivial ones, but gives opportunity to make state graphs
I will try to get this fixed for coming release :-)

 thanks,

Daniel

Interesting the following patterns all pass, even though conceptually they
are the same pattern.  So I guess there is a difference between handling c?
and c{0,1}.  That might give a clue as to how to fix the problem.

=>ab?c?
a
ab
abc
ac
=>ab{0,1}c{0,1}
a
ab
abc
ac
=>ab{0,1}c?
a
ab
abc
ac
=>ab?c{1,2}
ac
abc
abcc
acc

For the IP address pattern, the simplest I could get it is to:

=>((2{1,2}|24)\.){2}2
#fails
24.24.2

If it would help to have these in the form of a Git patch or some other
format let me know.

Thanks,

Pete.
-- 
---------------------------------------------------------------------
Pete Cordell
Codalogic Ltd
Read & write XML in C++: http://www.xml2cpp.com
---------------------------------------------------------------------

On 15/04/2016 17:48, Pete Cordell wrote:
Hi there,

Please can I submit the following regexp test files that should pass,
but when I test them they fail.  (I'm afraid I'm not smart enough to
suggest how to fix the code!)

I've attached them and included a git patch so hopefully one of the
formats is convenient for you.  If not, let me know what would work
better.  I've included them inline below so you can do a quick scan.

test/regexp/fussyipaddress
--------------------------
=>((1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])\.){3}(1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])

192.168.254.0

test/regexp/timestamp
---------------------
=>\d{8}T\d{6}\.?\d{0,6}
# This gives incorrect result
20160412T112319
# These give correct result
20160412T112319.
20160412T112319.43
20160412T112319.432312

Thanks,

Pete.


_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xml gnome org
https://mail.gnome.org/mailman/listinfo/xml

_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xml gnome org
https://mail.gnome.org/mailman/listinfo/xml

-- 
Daniel Veillard      | Open Source and Standards, Red Hat
veillard redhat com  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | virtualization library  http://libvirt.org/


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]