On Thu, Jun 25, 2009 at 4:31 AM, Xiangjun Wu<neta...@gmail.com> wrote:
That's the type of regular expression that typically leads to a
combinatorial explosion in regex engines unless they use specific
"tricks" to deal with this. Recent versions of Perl are pretty clever
in this regard (they look for "floating" substrings) while CL-PPCRE
isn't, but - frankly - I don't really see the point of this. I think
this is mainly so that the regex engine looks good in benchmarks. I
definitely wouldn't call this a bug.
The question is - what do you want to achieve with this regular
expression? Can't you write it in a simpler way?
cl-ppcre-devel site list
> The question is - what do you want to achieve with this regular
> expression? Can't you write it in a simpler way?
Isn't this pattern pretty useful in general:
where A and B are word characters and @ is a specific non-word
How else could we specify it?
[a-zA-Z0-9] doesn't seem acceptable to me since it relies on
the latin alphabet...
> On Jun 25, 9:21 pm, Edi Weitz <e...@agharta.de> wrote:
>> The question is - what do you want to achieve with this regular
>> expression? Can't you write it in a simpler way?
> Isn't this pattern pretty useful in general:
> where A and B are word characters and @ is a specific non-word
Sure, but the original bug report was about this:
I can't make any sense of this regular expression, but maybe it is
because I am lacking some skills. Maybe Wu can explain what he wants
to achive with it?
It should be:
but other examples indicate the accurate idea.
Looking at this I'm not sure what this is good for.
Why would we want to match strings of the form _xxx@xxx
in a full-text indexer?
Perhaps it would be best to get rid of the whole messy
regex (of which this is only a small part) and write
a new documented one from scratch. Or use a custom
will work for your app? The problem in the original expression is the
"+" followed by the "*" can lead to a combinatorial explosion.
If you loosen the requirement that all non-zero matches in the first
expression must begin with an "_" you could have: