Re: [xsl] why matches($title,'.*?(\.|,)\s*$')) can perform so much worse than matches($title,'(\.|,)\s*$'))
2011-07-13 09:14:04
It would be perfectly valid (and sensible) for a query processor to
realise that the two expressions you gave were equivalent and so not
perform n^2 tests, but I am unaware of a processor that makes these
kinds of optimizations to regular expressions.
Actually I've heard it said that there's a wide variation between
different regex engines in how well they handle this kind of thing. See
for example here:
http://swtch.com/~rsc/regexp/regexp1.html
The article at
http://eyalsch.wordpress.com/2009/05/21/regex/
is also useful.
Michael Kay
Saxonica
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--
<Prev in Thread] |
Current Thread |
[Next in Thread>
|
- [xsl] why matches($title,'.*?(\.|,)\s*$')) can perform so much worse than matches($title,'(\.|,)\s*$')), Alex Muir
- Re: [xsl] why matches($title,'.*?(\.|,)\s*$')) can perform so much worse than matches($title,'(\.|,)\s*$')), Oliver Hallam
- Re: [xsl] why matches($title,'.*?(\.|,)\s*$')) can perform so much worse than matches($title,'(\.|,)\s*$')), Alex Muir
- Re: [xsl] why matches($title,'.*?(\.|,)\s*$')) can perform so much worse than matches($title,'(\.|,)\s*$')),
Michael Kay <=
- Re: [xsl] why matches($title,'.*?(\.|,)\s*$')) can perform so much worse than matches($title,'(\.|,)\s*$')), Oliver Hallam
- Re: [xsl] why matches($title,'.*?(\.|,)\s*$')) can perform so much worse than matches($title,'(\.|,)\s*$')), Michael Kay
- Re: [xsl] why matches($title,'.*?(\.|,)\s*$')) can perform so much worse than matches($title,'(\.|,)\s*$')), Oliver Hallam
- Re: [xsl] why matches($title,'.*?(\.|,)\s*$')) can perform so much worse than matches($title,'(\.|,)\s*$')), Liam R E Quin
|
Previous by Date: |
Re: [xsl] why matches($title,'.*?(\.|,)\s*$')) can perform so much worse than matches($title,'(\.|,)\s*$')), Alex Muir |
Next by Date: |
[xsl] format-number/bankers' rounding problem, daniel whitney |
Previous by Thread: |
Re: [xsl] why matches($title,'.*?(\.|,)\s*$')) can perform so much worse than matches($title,'(\.|,)\s*$')), Alex Muir |
Next by Thread: |
Re: [xsl] why matches($title,'.*?(\.|,)\s*$')) can perform so much worse than matches($title,'(\.|,)\s*$')), Oliver Hallam |
Indexes: |
[Date]
[Thread]
[Top]
[All Lists] |
|
|