Bugs item #1625381, was opened at 2006-12-31 11:42 Message generated for change (Comment added) made by collinwinter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1625381&group_id=5470
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Documentation Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Richard Boulton (richardb) >Assigned to: Fred L. Drake, Jr. (fdrake) Summary: re module documentation on search/match is unclear Initial Comment: 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." ---------------------------------------------------------------------- >Comment By: Collin Winter (collinwinter) Date: 2007-03-08 19:21 Message: Logged In: YES user_id=1344176 Originator: NO +1 on the general idea, though I'd change your "match() checks for a match at the beginning..." to "match() checks for a match starting at the beginning...". I'd also like to drop the reference to Perl entirely; saying that I should look to search() for Perl's semantics makes it sound like match() doesn't support PCREs. Fred, any thoughts? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1625381&group_id=5470 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com