Skip to content

Instantly share code, notes, and snippets.

@bperel
Created June 20, 2017 10:20
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 bperel/b75d9d18dce354908dbdb6a839bcc6da to your computer and use it in GitHub Desktop.
Save bperel/b75d9d18dce354908dbdb6a839bcc6da to your computer and use it in GitHub Desktop.
Regexes
(/(\$[a-zA-Z0-9]+) = (new [^;]+;)\n([ ]{4})\3\1->/g,'$1 = $2\n$3$3$1\n$3$3$3->')
(/(\$[a-zA-Z0-9]+)\n([ ]{4})(\2\2->(?!persist)[^;]+);\n\2\2\1->/g,'$1\n$2$3\n$2$2$2->')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment