This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Walter Farrell
Recipients Walter Farrell, ezio.melotti, mrabarnett
Date 2016-11-14.16:24:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1479140687.65.0.411208896351.issue28690@psf.upfronthosting.co.za>
In-reply-to
Content
Given:
  pattern = r"(^|[^\\])<(pm [^ ]+( +|'[^']*'|\"[^\"]*\"|[^>]+)+)>"
  s = "<b>Bain, F. W.</b> <pm href 'Digit of the moon, and other"

import re
  m = re.search(pattern, s)

The re.search call seems to loop, never returning (or, at least never returning as long as I was willing to wait).

Note that with a ">" added to the end of s, it returns quickly with a match. Without the ">" it should fail, but instead seems to loop.

(If I use the regex module instead of re, it fails properly and quickly.)

Python 3.5.1, Windows 10:
Python 3.5.1 (v3.5.1:37a07cee5969, Dec  6 2015, 01:54:25) [MSC v.1900 64 bit (AMD64)] on win32
History
Date User Action Args
2016-11-14 16:24:47Walter Farrellsetrecipients: + Walter Farrell, ezio.melotti, mrabarnett
2016-11-14 16:24:47Walter Farrellsetmessageid: <1479140687.65.0.411208896351.issue28690@psf.upfronthosting.co.za>
2016-11-14 16:24:47Walter Farrelllinkissue28690 messages
2016-11-14 16:24:47Walter Farrellcreate