im trying out the fuzzy function of the new regex module. in this case, i want there to find a match for all strings with <= 1 errors, but i'm having trouble with it
import regex
statement = 'eol the dark elf'
test_1 = 'the dark'
test_2 = 'the darc'
test_3 = 'the black'
print regex.search('{}'.format(test_1),statement).group(0) #works
>>> 'the dark'
print regex.search('{}'.format(test_1){e<=1},statement).group(0)
>>> print regex.search('{}'.format(test_1){e<=1},statement).group(0) #doesn't work
^
SyntaxError: invalid syntax
i have also tried
print regex.search('(?:drk){e<=1}',statement).group(0) #works
>>> 'dark'
but this . . .
print regex.search(('(?:{}){e<=1}'.format(test_1)),statement).group(0) #doesn't work
>>> SyntaxError: invalid syntax