regex doubts

Fredrik Lundh fredrik at pythonware.com
Sun Jul 20 10:30:16 EDT 2008


John Machin wrote:

>> try "[LRM]+$" (an L or an R or an M, one or more times, all the way to
>> the end of the string).
> 
> Ummm ... with the default flag settings, shouldn't that be \Z instead
> of $ ?

Why?  The OP was reading input from a user; whether he gets a trailing 
newline or not depends on the input method, and $ does the right thing 
for all normal input methods.

</F>




More information about the Python-list mailing list