Skip to content

Instantly share code, notes, and snippets.

@awaemmanuel
Forked from bsima/regex-solutions.txt
Created January 8, 2016 18:09
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 awaemmanuel/09cdfdd73e7cc43edd86 to your computer and use it in GitHub Desktop.
Save awaemmanuel/09cdfdd73e7cc43edd86 to your computer and use it in GitHub Desktop.
The sample text is here: https://gist.github.com/0474c33e403ab243019c
Undo justification: replace all newline characters with two spaces
regex: "\n\b"
subst: "\ \ "
Replace all paragraph markers with actual paragraphs
regex: "-P-"
subst: "\n\n"
Substitute two or more spaces with a single space
regex: "\ \ +"
subst: "\ "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment