Skip to content

Instantly share code, notes, and snippets.

@thebuilder
Created July 2, 2015 21:51
Show Gist options
  • Save thebuilder/550424d82d2c7c0ec99f to your computer and use it in GitHub Desktop.
Save thebuilder/550424d82d2c7c0ec99f to your computer and use it in GitHub Desktop.
Angular Module RegEx
//Find angular.module definition. $2 contains the modules defined. Append with replacing like:
// $1$2,\n require('newModule')$3
/(angular.module\(.+\[)(.*)(\]\))/g
//Capture all methods called on the angular module. Allows you to append to it. with $&
/(?:angular.module\(.+\))(\s+\..+\))+/g
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment