Has anyone got an emacs regexp handy to do the following generic replacement?
(*ptr_to_struct).member_var to ptr_to_struct->member_var
where ptr_to_struct is any pointer to struct and member_var is any member variable
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can try to substitute
(\*\([a-zA-Z_][a-zA-Z_0-9]*\))\.\([a-zA-Z_][a-zA-Z_0-9]*\)with\1->\2, where:[a-zA-Z_][a-zA-Z_0-9]*catches the C identifier\(…\)record a match for substitutionYou can play with regular expression in Emacs using the integrated regexp builder: M-x
re-builder.