Reputation: 3163
Lets assume I have the following string:
string = "xxx abc123 xxx"
I want the regular expression to replace the digits in the string that begin with 'abc'. I have tried the following, but with no luck:
re.sub(r'\d{1,3}\babc','456',string)
Thanks.
Upvotes: 0
Views: 133