ios - Regex for searching method bodies in source code -


i need find method bodies in ios source code. i've started writing simple regex: \{.*\} things goes complex when need handle nested parentheses.

so started think direction. tried detect method declaration this: [+-].+ \{, can find end of method next pattern: \}\s+[+-], here's bad case it:

- (void)method:(id)arg0 :(id)arg1 third:(id)arg3 { ... }  #pragma mark - bla-bla  - method2:(id)arg0 {    code(    {    });    if (1) {    }    -1; } 

can have ideas or algorithms or regex detect method bodies correctly?


Comments

Popular posts from this blog

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -

python 3.x - Mapping specific letters onto a list of words -