I am maintaing a linux driver and I want to replace all %p in driver with %pK. For doing this i used following command.
grep "%p[^K]" -Rl . | xargs sed -i 's/%p[^K]/%pK/g'
It fails in below case.
%p-%p --> %pK%pK (hyphen is removed)
Please suggest proper regular expressionfor sed command to work.