My regex is not really doing what I want it to. It needs to find all matches in my text file where the line starts with:
func anyword() {
The pattern will do this, but I want it to stop on the next }
. But if one or more of this appears:
SomeFunction();
it should skip the next }
.
Here is an example of the text it would scan. Each line is commented to show what it should do there:
override func something() { // here is a start pattern
// still looking for an }
halloworld() { }; // bracket } found but is ignored because line also contains "()"
// still looking for an }
// still looking for an }
} // found closing bracket } end of match
This is the pattern that I am currently using:
\w+\s+func\s\w+\(\)\{\s+(.*?)\s+\}