Created
July 15, 2011 07:35
-
-
Save swanandp/1084250 to your computer and use it in GitHub Desktop.
Regular Expression to remove Blank Lines, but keep indentation on other lines
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Regular expression for removing blank lines from a text: | |
#Replace this regex | |
/(\s+)^\r?\n?$(\s+)/mix | |
# With | |
$2 # The second match |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment