New submission from Eric Promislow <er...@activestate.com>:

This regular expression takes a few seconds to be evaluated
against any text:
(.*?)((?:X|\s+)*)$

This reg ex is much faster:

(.*?)((?:X|\s)*)$

To be fair, Ruby's performance with the first regex is the same as Python's. 
PHP and JavaScript both fail to match the first regex
at all.  Only Perl evaluates both regexes nearly instantly.

----------
messages: 150770
nosy: ericp
priority: normal
severity: normal
status: open
title: Regular expressions: (?:X|\s+)*$ takes a long time
type: performance
versions: Python 2.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue13723>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to