Nov-03-2019, 11:37 AM
(This post was last modified: Nov-03-2019, 11:37 AM by Gribouillis.)
re.sub() needs a second argument saying by what you want to replace the match in the initial string. Here you can use
case = re.sub(match, '', expression)or
match.sub('', expression)Also 'match' is not a very good name for a regex because it's often used for match objects which appear in this context. Better use 'pattern' or 'regex' or 'pat'...