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
Post a Comment