Emacs regex: any characters spanning multiple lines between matching pattern

Viewed 596

I want to find I - <characters> I - and replace it with I - <characters>, I -.

The <characters> can be anything including Tab, Newline, Whitespace, *, & etc.

For example: I - John M. Smith I - Should be replaced with I - John M. Smith, I -.

I tried something like:

M-x Query replace regexp
\(I - \)\([a-z]+\) \(I - \)
\1\2, \3

It is not working. Can you please help?

1 Answers
Related