human
Delete digits in Python (Regex)
assistant
Here is some code to delete all digits in string `s` that are not directly attached to a word character

re.sub('$\\d+\\W+|\\b\\d+\\b|\\W+\\d+$', '', s)

#Warning: this code generation is experimental. Please inspect the code for any bugs before executing.