i would like to find a specific string and delete it from on initial string.
in my case i want to find the word "LOT N° 1" and delete if from the PHRASE
can you help me to fix my code ?
in my case i want to find the word "LOT N° 1" and delete if from the PHRASE
import re expression ='LOT N° 1 that''s the first one' match = re.compile(r'LOT N°.[1-9] ') ## i am making a pattern who match the word that i want to delete case = re.sub(match,expression) print(case)the error message
Quote:---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-3-a9c93ba1b0f0> in <module>
5 match = re.compile(r'LOT N°.[1-9] ') ## i am making a pattern who match the word that i want to delete
6
----> 7 case = re.sub(match,expression)
8
9 print(case)
TypeError: sub() missing 1 required positional argument: 'string'
can you help me to fix my code ?