I was looking for a way to replace a common pattern in a URL path and maintain the ID specific integer in the string. I tried a few various options on stack overflow but I kept having the number before .pdf replaced. This regex statement finally worked.

Sample Value:


Desired Value:


Regex Statement:

Find: (\d)_(\d)

Replace: $1P$2