What I would like to do is to allow the user to input something such as: "Torsion ? Group", wildcard and all (the wildcard being a whole word) and a true or false returned depending on whether found or not. So would I have something such as \b*\b? The Python manual says that \bfoo\b will match strings of the form "something foo something else" as well as "foo.". the issue that I am having is that I am even trying to start simple modifying another example I found:
inputstring = 'What is a Torsion Abelian Group (TAB)?'
str1 = "Abelian"
output = re.search("Torsion" + \bstr1\b + "Group", inputstring)
print output
I however get the output:
output = re.search("Torsion" + \bstr1\b + "Group", inputstring)
^
SyntaxError: unexpected character after line continuation character
Thus I am having difficulties finding a known string, let alone a wildcard. Any thoughts on either would be extremely appreciated.
Thanks,
Brian