I am working to get familiar with regular expression in python and working with string like such:
string = "<<NAME>><<TIME>> (<<NAME>>) good <<NAME>><<NAME>> luck<<NAME>>START <<NAME>>"
# I try the following:
output = re.sub(r'\b<<NAME>>\b', "1234", string)
However, the output prints out the exact same thing. I thought \b
would isolate the word that I am looking and substitute it. How can I resolve this such that each <<NAME>>
will be replaced by "1234"?