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> -- http://mail.python.org/mailman/listinfo/python-list