Skip to content

Instantly share code, notes, and snippets.

@dannguyen
Created January 27, 2014 20:18
Show Gist options
  • Save dannguyen/8656413 to your computer and use it in GitHub Desktop.
Save dannguyen/8656413 to your computer and use it in GitHub Desktop.
Regex to wrap indented markdown with Github-flavored syntax

Find:

  ((?:^\n)(?:^\s{4,}.*)\n(?:^(?:\s{4,}.*\n|\n))*?(?=^\S))

Replace

  \n```ruby\n$1\n```\n\n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment