Skip to content

Instantly share code, notes, and snippets.

@syndicut
Created September 15, 2012 18:21
Show Gist options
  • Save syndicut/3729149 to your computer and use it in GitHub Desktop.
Save syndicut/3729149 to your computer and use it in GitHub Desktop.
Regexp to replace hook do end ruby block
^( *)<%= hook :([^ ,]+).*do %>(((?!^\1<% end %>).|\n)+)^\1<% end %>
\1<div data-hook="\2">\3\1</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment