Hi I am writing a script that requires some regex pattern matching but I am unable to make matches.
here is a MCVE:
import re
sourceString= 'Hi I want pizza for lunch'
patternObject=re.compile('pi.*');
match=patternObject.match(sourceString);
if match:
print("the match is:",match.group())
else:
print("no matches found!");
Unfortunately output of the program is "no matches found!" despite "pizza for lunch" being the desired output. What did I understand wrong?