Re: [xml] Failure Index Query in RegxpExec
- From: Daniel Veillard <veillard redhat com>
- To: Ashwin <ashwins huawei com>
- Cc: xml gnome org
- Subject: Re: [xml] Failure Index Query in RegxpExec
- Date: Fri, 24 Aug 2007 07:56:38 -0400
On Fri, Aug 24, 2007 at 04:00:48PM +0530, Ashwin wrote:
Hi,
In the case of FaRegxpExec function suppose I give an arbitrarily long
input string for the grammar :-
(0|1|2|3|4|5|6|7|8|9){0,10}.
Ideally I suppose the execution should stop at 10 and return failure
in case of an input more than the range, however the exec->index keeps
moving to the end of the input
string. In case of very long strings, avoiding this might be helpful.
There is zillions way you could try to optimize. The problem is making sure
this is exact. At the moment I really don't care to try to optimize performances
like that, this is useless IMHO, it would just make the code even more complex
and even harder to make sure it is right.
Also is there any way to catch hold of the index where the matching
fails?
No you generally can't as we use stateful parsing. If I wasn't using stateful
parsing then you would have *real* performance problems. Hopefully you
understand my answer, if that's not the case, it means you still need to study
that code a lot more before suggesting to change it ;-)
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]