Skip to content

Instantly share code, notes, and snippets.

@meklarian
Last active August 29, 2015 14:11
Show Gist options
  • Save meklarian/710021d9bfb90a55e569 to your computer and use it in GitHub Desktop.
Save meklarian/710021d9bfb90a55e569 to your computer and use it in GitHub Desktop.

replace empty lines before a brace

match:

^(?([^\r\n])\s)*\r?\n(?<stuff>(?([^\r\n])\s)*\})\r?\n

replace:

${stuff}\n

replace empty pairs of newlines

match:

^(?([^\r\n])\s)*\r?\n(?([^\r\n])\s)*\r?\n

replace:

\n

ref: http://stackoverflow.com/a/13987363/118939 - "regex - Remove empty lines using Visual Studio"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment