May-11-2017, 03:55 PM
Start with something simple, that you can test over and over, like maybe this:
But really, there's almost no python involved here... it's all just regular expressions.
import re regex = re.compile(r"your-regex-here") test_strings = [ "Jose", "Jjunior", "4chr", "letters", "ending-in-number5", "athenbthenc", "Capital", "doesn'tmatch@nyth1ng" ]I'd suggest using something like regexpal (http://www.regexpal.com/) to test out your regex quickly to find something that works for each case.
But really, there's almost no python involved here... it's all just regular expressions.