On Fri, Feb 20, 2009 at 12:22 AM, brock <[email protected]> wrote:
> r'(\:?[^\(\s\:]?[^\s\:]*)*\:'
As far as I can make out your problem is the regular expression above.
As a general rule avoid (...)* or (...)+ constructions when (...) can
match almost any string since the regular expression engine is then
forced to try a large number of possible values for (...).
It also seems to be a rather odd sort of regular expression to be
matching a token with since it matches repeats of some fairly
arbitrary strings.
The [^\(\s\:]? is redundant since any '(' can just be by-passed and
matched by the [^\s\:]* next to it.
Are you sure you can't use a regular expression like r'([^\s]+)*\:' (a
bit faster) or r'[^\s]*\:' (a LOT faster) instead? Possibly with some
post-processing elsewhere afterwards.
Schiavo
Simon
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"ply-hack" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/ply-hack?hl=en
-~----------~----~----~----~------~----~------~--~---