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 Jason.Stumpf
Recipients Jason.Stumpf, dbenbenn, ezio.melotti, janzert, mrabarnett, serhiy.storchaka
Date 2013-09-19.23:18:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1379632687.55.0.972976703326.issue19055@psf.upfronthosting.co.za>
In-reply-to
Content
Even with the documentation to |, the documentation to * is wrong.

>>> re.match('(a|ab)*c',('abac')).group(0)
'abac'

From the doc: In general, if a string p matches A and another string q matches B, the string pq will match AB.

Since '(a|ab)*c' matches 'abac', and 'c' matches 'c', that means '(a|ab)*' matches 'aba'.  It does so with 2 repetitions.  Thus, in the example from my initial post, it was not matching with as many repetitions as possible.

I think what you mean is that * attempts to match again after each match of the preceding regular expression.
History
Date User Action Args
2013-09-19 23:18:07Jason.Stumpfsetrecipients: + Jason.Stumpf, dbenbenn, ezio.melotti, mrabarnett, serhiy.storchaka, janzert
2013-09-19 23:18:07Jason.Stumpfsetmessageid: <1379632687.55.0.972976703326.issue19055@psf.upfronthosting.co.za>
2013-09-19 23:18:07Jason.Stumpflinkissue19055 messages
2013-09-19 23:18:07Jason.Stumpfcreate