[Solved] regex, search a few letter in one word [closed]


You may try using the regex pattern l.*t.*e, e.g.

my_str = "little"
if re.match(r'l.*t.*e', my_str):
    print "MATCH"

More generally, if you want to find l..t..e within a single word, then try:

my_str = "little"
if re.match(r'\b\w*l.*t.*e\w*\b', my_str):
    print "MATCH"

2

solved regex, search a few letter in one word [closed]