When I found out that the python regex module allows fuzzy matching I was increasingly happy as it seemed as a simple solution to many of my problems. But now I am having a
You need to put your strings together correctly.
import regex testString = 'some phrase' r = regex.compile('('+testString+'){e<=5}') r.match('phrase')
If you want to build a regex pattern, you'll need to use various string manipulation techniques to build up the appropriate pattern to use.