Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
Created·2014-07-09 21:24
Flavor·JavaScript

/
^\s*function\s+(\w+)\s*\(
/
Open regex in editor

Description

Extracts the name of the outer function. Useful to get the name of a function reference using fn.toString().

Submitted by Jack A.