On Fri, Feb 20, 2009 at 3:51 PM, Simon Cross <[email protected]> wrote: > On Fri, Feb 20, 2009 at 12:22 AM, brock <[email protected]> wrote: >> r'(\:?[^\(\s\:]?[^\s\:]*)*\:'
> 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 bit above is a misleading (I'm being kind and not calling myself wrong :). > 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. I am of course being completely silly -- r'(\:?[^\(\s\:]?[^\s\:]*)*\:' and r'[^\s]*\:' match exactly the same set of strings. The latter is about 100 000 times faster at failing to match short strings than the former. Hopefully my lack of sleep has not now led to make *two* somewhat silly posts. :) 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 -~----------~----~----~----~------~----~------~--~---
