Re: [xml] Additional regexp test files

2016-05-03 Thread Daniel Veillard
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
veill...@redhat.com  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | virtualization library  http://libvirt.org/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
https://mail.gnome.org/mailman/listinfo/xml


[xml] Additional regexp test files

2016-04-15 Thread Pete Cordell

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.
--
-
Pete Cordell
Codalogic Ltd
C++ tools for C++ programmers, http://codalogic.com
Read & write XML in C++, http://www.xml2cpp.com
-
>From 8353cdd05e3ad8c241e5383ca0745948f7a6cc58 Mon Sep 17 00:00:00 2001
From: Pete Cordell 
Date: Fri, 15 Apr 2016 17:33:17 +0100
Subject: [PATCH] Added regexp tests that fail but should pass

---
 test/regexp/fussyipaddress | 2 ++
 test/regexp/timestamp  | 7 +++
 2 files changed, 9 insertions(+)
 create mode 100644 test/regexp/fussyipaddress
 create mode 100644 test/regexp/timestamp

diff --git a/test/regexp/fussyipaddress b/test/regexp/fussyipaddress
new file mode 100644
index 000..3e4b44f
--- /dev/null
+++ b/test/regexp/fussyipaddress
@@ -0,0 +1,2 @@
+=>((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
diff --git a/test/regexp/timestamp b/test/regexp/timestamp
new file mode 100644
index 000..0cc4b59
--- /dev/null
+++ b/test/regexp/timestamp
@@ -0,0 +1,7 @@
+=>\d{8}T\d{6}\.?\d{0,6}
+# This gives incorrect result
+20160412T112319
+# These give correct result
+20160412T112319.
+20160412T112319.43
+20160412T112319.432312
-- 
2.5.3.windows.1

=>((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
=>\d{8}T\d{6}\.?\d{0,6}
# This gives incorrect result
20160412T112319
# These give correct result
20160412T112319.
20160412T112319.43
20160412T112319.432312
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
https://mail.gnome.org/mailman/listinfo/xml