I would like to search my Visual Studio C++ Project for array version of new operator e.g.
some_type some_variable = new my_name [some_size];
I tried this but it doesn’t work:
new [a-zA-Z0-9]+ \[
How can I achieve this with regex ?
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 need to allow all valid identifier characters in your character class (the
[a-zA-Z0-9]+part). In your example, you have an underscore, for instance. Also, you might want to make the space between the identifier and the brackets optional.Try this:
But check the specifications regarding exactly what characters are valid for
my_name