Regex. Replace particular characters in string

In the following string i need to replace (with Regex only) all _ with the dots, except ones that are surrounded by digits. So this:


Should become


Tried lots of things. That's where i got so far:


But it obviously doesn't work.


Try finding the following regex pattern:


And then just replace that with dot. The logic here is that a replacement happens whenever an underscore which has at least one non digit on either side gets replaced with a dot. The regex pattern I used here asserts precisely this:

(?<=\D)_    an underscore preceded by a non digit
|           OR
_(?=\D)     an underscore followed by a non digit


Regex. Replace particular characters in string
See more ...