I have a bunch of C macros in files, for example, NEXT( pL ) , which expands to ( ( pL ) -> next )
I want to remove most of them because they are not needed.
What I would like to do is get the text inside the brackets in the macro, pL . I want the regex replacement to use this text for rewriting. For example, in Perl, I could do something like /NEXT\(\s*(.+)\s*) (maybe a little wrong), and then output something like $1->next , which should include the line
if ( NEXT( pL ) != NULL ) {
in
if ( pL->next != NULL ) {
In Emacs, I would like to use match groups in emacs replace-regexp in file by file. I'm not quite sure how to do this in Emacs.
source share