visual studio - how to match function code block with regex -
What I like to do, all tasks are removed, for example a specific word, if the word 'apple' Is:
void eatapple () {// blah // blah}
I have all the code from ' zero
I tried to delete '}
' which I have tried:
^ Nil. * Apple (| | \ n) *}
But it will take a lot of time that I think there is something wrong here.
I'm using Visual Studio Thank you.
To clarify the final solution of Jeong, which I think is very clever: this work Does, but it depends on the code which is formatted in a special way. But that's fine, because most IDEs can implement a particular formatting standard. If I can give a related example - The problem that brings me here - I was looking for Java to find the form (expressions)
If (DEBUG) probably arbitrary statement or block}
Which, of course, is not technically routine, but I have run the eclipse code format on the files so that it can be ensured that they all look like this (our company Desired code style):
if (DEBUG) {statement (); While (whichever is) {Blahblabla (etc); } // ...}
and then search for it (this is the Java regex syntax, of course)
^ (\ s *) If \ \ (DEBUG. * (?: \ N \ 1. *) * \ N \ 1 \}
did the trick.
Comments
Post a Comment