Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.