You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xml.apache.org by Etienne Roy <er...@us.ibm.com> on 2001/04/26 23:40:54 UTC

regexp validation with XercesJ

Hi all,

I've got a problem validating against a regexp pattern for an attribute.
Simplifying my regexp I found a weird behaviour of the validator:

(([0-9]*[.][0-9]+)|([0-9]+))    matches  '1' and '1.23' but
(([0-9]+)|([0-9]*[.][0-9]+))    matches '1' but NOT '1.23'

Is there a problem with my regexp ? Or did anyone encountered something
similar ??
Thanks for any help

Etienne

--
More details:

I use xerces-J 1.3.1
java version "1.3.0"
I validate with sax.SAXCount -v (and I tried dom.DOMCount -v)

snippet of my schema:
   <simpleType name="TestRegExp">
     <restriction base="string">
               <pattern  value='(([0-9]+)|([0-9]*[.][0-9]+))'/>
     </restriction>
   </simpleType>

I had the same behaviour with '*' instead of '+', with or without
parenthesis, with [.] or \.


---------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
For additional commands, e-mail: general-help@xml.apache.org