I have a line like below.
fullname = (this is a test name);
I want to double quote all the strings inside “(” and “)”.
i.e fullname = (“this” “is” “a” “test” “name”);
Can someone give me a vim regex to do that?
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.
This does it:
Be aware that matching nested patterns (such in parentheses) with regex will go wrong if the input is malformed. The above does not handle nested parentheses at all, and quoted or escaped parentheses will also break it. Handle with care.
It reads as follows:
It is a notable fact that vim does actually support variable length look-behind. Most modern regex implementations do not.