Mmmh, I wrote the former message in the train, and it was written too quickly :-).
No need to change anything in the function, just put an entry in you json :
Code:
"au": ["ol", "[Pp]\\K{}(?=[a-z]+\\b)"]
and it will do exactly what you've asked.
Explanation :
The regex will be stuffed in the function with "au", so we'll apply :
[Pp]\Kau(?=[a-z]+\b)
Find [Pp] then forget this (start from after [Pp]) (because of \K)
Find "au", but only if there is [a-z]+\b after it (because of the positive lookahead)
So only "au" is selected, and it will be replaced by "ol"
BUT: get the new version of the function above, I''ve corrected a little bug that would have brought an exception in some cases.