"in python, how to check if a string only contains certain characters?",bool(re.compile('^[a-z0-9\\.]+\\Z').match('1234\n'))