Poul-Henning Kamp added the comment:

I have tried hard, but have utterly failed to figure out why you have chosen 
the semantics for ^ you mention, tried to come up with a plausible use case, 
and I have utterly failed.

I find it distinctly counter intuitive.

I think the Principle of Least Astonishment compliant definition of ^ and $ 
would be that they match the start and end of the string offered for matching, 
ie: taking start+end into account.

The real use-case behind this is searching through a mmap'ed database file, for 
a particular regexp in a particular field of the records, with the minimum 
amount of copying.

The semantics you mention, makes ^ and $ useless in this, and as far as I can 
tell, any other scenario involving start+end arguments.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue16870>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to