Using Python, I want to search for, for example, 'tune yards' in a block of text that may say 'tune-yards' (with a hyphen) and it may say 'tune yards' (without). I want both to be considered matches. I’m using the find() function. Is there a good Pythonic way to treat - and spaces as one and the same, instead of just stacking elif statements?
Something like this: (I know this doesn’t work :P)
treating '-' as ' ':
if blockOfText.find('tune yards') > -1:
do something
And match objects are always true (with the other possible returned value being
None), so the result can be tested viaif.