I have a program that expects an input saying "yes", something like:
my_input = raw_input('> ')
if my_input == 'yes':
#etc
But that's too specific, I want the input to match this regex: [yY](es)?
, so that if the user puts "yes, Yes, y or Y", it is the same. But I don't know how is this implemented in python.
I want something like:
regex = some.regex.method('[yY](es)?')
my_input = raw_input('> ')
if my_input == regex:
#etc
Thank you in advance.