Created
November 12, 2015 20:23
-
-
Save jhildensperger/673cfa62c64e61143375 to your computer and use it in GitHub Desktop.
Regular expressions to fix Swift formatting
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
// (optionalType?.nonOptionalType)! -> optionalType!.nonOptionalType | |
// find | |
\((\w+)\?\(.\w+)\)\! | |
// replace | |
$1!$2 | |
// poorly formatted if statements | |
// find | |
if\s*\(\s*(.*\b)\s*\)\s*{ | |
// replace | |
if $1 { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment