Gabriel Genellina wrote:
> En Sat, 24 Jan 2009 18:23:51 -0200, MRAB <goo...@mrabarnett.plus.com>
> escribió:
>
>> Some time ago I discovered this difference between regular expressions
>> in Python and Perl:
>>
>> Python
>>
>>     \A matches at start of string
>>     \Z matches at end of string
>>
>> Perl
>>
>>     \A matches at start of string
>>     \Z matches before terminal newline or at end of string
>>     \z matches at end of string
>>
>> In Perl \A == ^ and \Z == $ in single-string mode, but in Python \A == ^
>> and \Z != $ in single-string mode.
>
> Why do you want the two to be equivalent? Isn't a good thing that you
> have both alternatives (\Z and $)? Use whichever is adequate in each case.
>
Python's \Z is equivalent to Perl's \z, but there's no equivalent to Perl's \Z in multi-line mode.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to