Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (?x)^
- (\s*
- (module|class|def
- |unless|if|else|elsif
- |case|when
- |begin|rescue|ensure
- |for|while|until
- |(?= .*? \b(do|begin|case|if|unless)\b )
- # the look-ahead above is to quickly discard non-candidates
- ( "(\\.|[^"])*+" # eat a double quoted string
- | ''(\\.|[^''])*+'' # eat a single quoted string
- | [^#"''] # eat all but comments and strings
- )*
- ( \s (do|begin|case)
- | [-+=&|*/~%^<>~] \s*+ (if|unless)
- )
- )\b
- (?! [^;]*+ ; .*? \bend\b )
- |( "(\\.|[^"])*+" # eat a double quoted string
- | ''(\\.|[^''])*+'' # eat a single quoted string
- | [^#"''] # eat all but comments and strings
- )*
- ( \{ (?! [^}]*+ \} )
- | \[ (?! [^\]]*+ \] )
- )
- ).*$
Add Comment
Please, Sign In to add comment