Re: [xml] Failure Index Query in RegxpExec



On Fri, Aug 24, 2007 at 08:55:16PM +0530, ashwin sinha wrote:
   On 8/24/07, Daniel Veillard <[1]veillard redhat com> wrote:
     Hi,
             You  are  on  the button, I mean I know i still have lots to
   learn,  especially  with  respect to the  regular expression code. The
   thing  is  I  have to deal with a requirement wherein I need to return
   the  index  in  case  of  a  partial match. So I was trying to use the
   exec->index  variable  to get the failure index, however no matter how
   much i tried there was always some case which i did not consider, so I
   thought  of  having  a  second opinion on whether it could actually be
   done or not......

  unfortunately no, we could at best provide a suggested one but that's all
Take for example
    [0-9]{1-3}|[0-1]{5}
with an input of
    1210
 on one side of the branch you would consider the 0 to be the first character
in error on the other side of the branch the 2 . You can't guess which one
the user made an error with. I think your requirement makes no sense, unless
I misunderstood it.
  Point is xmlregexp was designed for validating XMLSchemas datatypes, so it
is built to give a yes/no answer, it was not designed to build general
regexp services.

Daniel

-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/



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