[issue16430] re.match blocking and taking 100% CPU

2012-11-07 Thread Mark Dickinson

Mark Dickinson added the comment:

This is a known issue: there are a good few duplicates in the tracker.  Issue 
#1662581 is one, for example.

In this particular case, you can probably fix things by tightening up your 
regex.  Part of the problem is that '.*' is going to match any sequence of 
characters, including spaces.  Judicious use of '\S' to match non-whitespace 
characters might help. There's not much point to the '?' in  '.*?', either.

--
nosy: +mark.dickinson
superseder:  -> the re module can perform poorly: O(2**n) versus O(n**2)

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16430] re.match blocking and taking 100% CPU

2012-11-07 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

There is no a Python bug.

You have wrong regexp.  Remove "$" at the end or add ".*" before "$".

And it would be better if instead of '(?P.*?)\s' and 
'"(?P.*?)"' you use '(?P\S+)\s' and '"(?P[^"]*)"'.

--
nosy: +serhiy.storchaka
resolution:  -> invalid
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16430] re.match blocking and taking 100% CPU

2012-11-07 Thread Sebastien Estienne

New submission from Sebastien Estienne:

Hello

re.match is blocked and takes 100% cpu forever

re_bug.py is an example of the bug.

thanx

--
components: Regular Expressions
files: re_bug.py
messages: 175109
nosy: Sebastien.Estienne, ezio.melotti, mrabarnett
priority: normal
severity: normal
status: open
title: re.match blocking and taking 100% CPU
versions: Python 2.6, Python 2.7
Added file: http://bugs.python.org/file27921/re_bug.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com