arnimavidyarthy at gmail.com wrote: > I am taking a string as an input from the user and it should only > contain the chars:L , M or R How about skipping re's and doing something like: set(input_string) <= set('LMR') If you want to disallow the empty string: set([]) < set(input_string) <= set('LMR') --Scott David Daniels Scott.Daniels at Acm.Org