That doesn't work, I'm being stupid, The user might type anywhere in the string, not just at the end. I need return all([c in '1234567890abcdefABCDEF ' for c in after])