I have a few header strings in a file that I'd like to replace with expected_status. header appears either as headers or header:. I only want to replace those with the colon with expected status, so: header: --> expected_status:
I am using replace-regexp with the following command:
Replace string (default \(header\):?$ -> expected_status):
However, it is not replacing properly. It is replacing the colon as well with expected_status. Is there a way to let emacs only do the replacement on the identified regexp group?