Match javascript functions RegExp

/function\s?(\w+)?\s?\(\w*\)\s?\{(.|\n|\r)*\}/g
Useful regular expressions to grab all functions in a string (single or multi-line) without hassle.

Ex: function hello(param) { expression; } will be fetched by this regular expression.

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.