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 richardb
Recipients
Date 2006-12-31.16:42:04
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Section 4.2.2 ("Matching vs Searching") of the Python Library Reference covers the match and search methods of regular expression objects.  However, it doesn't begin by describing the difference between these methods.  Each time I try to remember which way round match and search are, it takes several minutes of checking the documentation to work out which is which. I suggest that the first paragraph of the section is replaced with the following text (in two paragraphs), to make the distinction between the methods clearer:

"Python offers two different primitive operations based on regular expressions: match and search.  match() checks for a match at the beginning of the search string, whereas search() checks for a match anywhere in the string.

If you want something equivalent to Perl's semantics, the search operation is what you're looking for. See the search() function and corresponding method of compiled regular expression objects."
History
Date User Action Args
2007-08-23 14:50:54adminlinkissue1625381 messages
2007-08-23 14:50:54admincreate