I came across this issue sometime last year, got the solution from the resident Emacs wizard and forgot about it. Last week, it happened again. I'm recording it now so I don't forget about it.
Emacs lets you search and replace in a buffer with regular expressions. So far so cool. I needed to replace a part of a lot of HTML links in a file.
<a href="/path/to/file" title="some title">Go!</a>
was to become
<a href="/path/to/file" title="other title">Go!</a>
with varying values for the title attribute obviously. So I searched for
<a href="/path/to/file" title="([^\"]*)">Go!</a>
and Emacs complained about some invalid regex. Darn. I double and triple checked all necessary escape sequences (which I omitted here for clarity) and finally asked the wizard.
Easy, Emacs doesn't konw the * quantifier. Do …
[Read more]