Skip to content

Instantly share code, notes, and snippets.

Created May 11, 2010 01:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/396799 to your computer and use it in GitHub Desktop.
Save anonymous/396799 to your computer and use it in GitHub Desktop.
# Taken from add_expr_literal in ActionView::Template::Handlers::Erubis, Rails beta3
ruby-1.9.2-head > BLOCK_EXPR = /(do|\{)(\s*\|[^|]*\|)?\s*\Z/
=> /(do|\{)(\s*\|[^|]*\|)?\s*\Z/
ruby-1.9.2-head > x = 'todo'
=> "todo"
ruby-1.9.2-head > x =~ BLOCK_EXPR
=> 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment