Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- \{\s*(?<Body>
- (?>
- # inside a multi line comment
- (?(InCommentML)
- (?<Comments>(?:[^*/]|(?!\*)/|\*(?<!/))+)
- \*/\s* (?<-InCommentML>)
- # not inside a multi line comment
- |
- (?:
- # inside a single line comment
- (?(InCommentSL)
- (?<Comments>[^\n\r]+)
- [\r\n]+ (?<-InCommentSL>)
- # not in a comment
- |
- (?:
- # single line comment
- // (?<InCommentSL>)
- |
- # multi line comment
- /\* (?<InCommentML>)
- |
- # match lines until any of the following are found: //, /*, new line, or change scope
- (?<Code>(?!/)/|/(?!\*)|(?!/)\*|[^{}\r\n/*]+)\s*
- |
- # open scope
- \{\s* (?<Scope>)
- |
- # close scope
- \}\s* (?<-Scope>)
- )
- )
- )
- )
- )*
- # fail clause: a scope was not closed
- (?(Scope)(?!))
- )\}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement