Regular expressions

Michael Torrie torriem at gmail.com
Mon Nov 2 22:51:15 EST 2015


On 11/02/2015 07:42 PM, Tim Chase wrote:
> On 2015年11月02日 20:09, Seymore4Head wrote:
>> How do I make a regular expression that returns true if the end of
>> the line is an asterisk
>> Why use a regular expression?
>> if line[-1] == '*':
> yep(line)
> else:
> nope(line)

Indeed, sometimes Jamie Zawinski's is often quite appropriate:
 Some people, when confronted with a problem, think "I know, I'll use
regular expressions." Now they have two problems.


More information about the Python-list mailing list

AltStyle によって変換されたページ (->オリジナル) /