Add a space between function and opening bracket (function.+\))\{ $1 { Dots should be at the start of a line, not the end \.(\n\s*)(?=\S+) $1. Control flow statements should use proper whitespace (^|\s+)(while|do|if|switch)\((.+)\{ $1$2 \($3\) \{ \}(\s*)(else|else if)(.*)\{ \} $2$3 \{