Re: [Python-Dev] why we have both re.match and re.string?

2016-02-10 Thread Steven D'Aprano
On Wed, Feb 10, 2016 at 10:59:18PM +0100, Luca Sangiacomo wrote: > Hi, > I hope the question is not too silly, but why I would like to understand > the advantages of having both re.match() and re.search(). Wouldn't be > more clear to have just one function with one additional parameters like > t

Re: [Python-Dev] why we have both re.match and re.string?

2016-02-10 Thread Michel Desmoulin
Hi, Le 10/02/2016 22:59, Luca Sangiacomo a écrit : Hi, I hope the question is not too silly, but why I would like to understand the advantages of having both re.match() and re.search(). Wouldn't be more clear to have just one function with one additional parameters like this: re.search(rege

[Python-Dev] why we have both re.match and re.string?

2016-02-10 Thread Luca Sangiacomo
Hi, I hope the question is not too silly, but why I would like to understand the advantages of having both re.match() and re.search(). Wouldn't be more clear to have just one function with one additional parameters like this: re.search(regexp, text, from_beginning=True|False) ? In this way w