Guest User

Untitled

a guest
Feb 19th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. (?x)^
  2. (\s*
  3. (module|class|def
  4. |if|else|elsif
  5. |case|when
  6. |begin|rescue
  7. |for|while|unless
  8. |(?= .*? \b(do|begin|case|if|unless)\b )
  9. ( "(\\.|[^"])*+" # eat a double quoted string
  10. | ''(\\.|[^''])*+'' # eat a single quoted string
  11. | [^#"''] # eat all but comments and strings
  12. )*
  13. ( \s (do|begin|case)
  14. | [-+=&|*/~%^<>~] \s*+ (if|unless)
  15. )
  16. )\b
  17. (?! [^;]*+ ; .*? \bend\b )
  18. |( "(\\.|[^"])*+" # eat a double quoted string
  19. | ''(\\.|[^''])*+'' # eat a single quoted string
  20. | [^#"''] # eat all but comments and strings
  21. )*
  22. \{ (?! [^}]*+ \} )
  23. ).*$
Add Comment
Please, Sign In to add comment