I would like to get the string after a specific keyword.
For example:
import re
def findWholeWord(w):
return re.compile(r'\b({0})\b'.format(w), flags=re.IGNORECASE).search
abc = "<StephenCurry Pro='ThreepointShooter'>MVP1times</StephenCurry>"
if findWholeWord("SeedNumber")(abc):
dddd = re.search('(?<=ThreepointShooter)(.\w+)', abc)
mvp = dddd.gorup()
print (mvp)
print ("found")
else:
print ("not found")
I expect the result suppose to be 'MVP1times'.
Is there any better method to find a specific string after keyword ? the result maybe a string, Digit or even mix like the result above.
Thanks for help!