time-to-botec/js/node_modules/@stdlib/regexp/function-name/docs/repl.txt

31 lines
594 B
Plaintext
Raw Normal View History

{{alias}}()
Return a regular expression to capture a function name.
Returns
-------
re: RegExp
Regular expression.
Examples
--------
> var RE_FUNCTION_NAME = {{alias}}();
> function beep() { return 'boop'; };
> var name = RE_FUNCTION_NAME.exec( beep.toString() )[ 1 ]
'beep'
> name = RE_FUNCTION_NAME.exec( function () {} )[ 1 ]
''
{{alias}}.REGEXP
Regular expression to capture a function name.
Examples
--------
> var str = {{alias}}.REGEXP.exec( Math.sqrt.toString() )[ 1 ]
'sqrt'
See Also
--------