Hi,
During search/replace, how can I use  the evaluation of a lisp expression as the substitution string?

An example could be ... say I want to replace the occurrence of a certain word with the word prefixed with its occurrence count - 

For example -  If I'd like to replace the occurrence of sea in  - 
She sells sea shells on the sea shore
with
She sells (1)sea shells on the (2)sea shore.

Or perhaps a more frequent use case of adding line number to each line

(while I was typing this, I got the idea of using the keyboard macro to achieve this .... is there a better way though?)

Regards,
Kashyap