40 lines
760 B
Plaintext
40 lines
760 B
Plaintext
|
|
{{alias}}()
|
|
Returns a regular expression to parse a regular expression string.
|
|
|
|
Regular expression strings should be escaped.
|
|
|
|
Returns
|
|
-------
|
|
re: RegExp
|
|
Regular expression.
|
|
|
|
Examples
|
|
--------
|
|
> var RE = {{alias}}();
|
|
> var bool = RE.test( '/^beep$/' )
|
|
true
|
|
> bool = RE.test( '/boop' )
|
|
false
|
|
|
|
// Escape regular expression strings:
|
|
> bool = RE.test( '/^\/([^\/]+)\/(.*)$/' )
|
|
false
|
|
> bool = RE.test( '/^\\/([^\\/]+)\\/(.*)$/' )
|
|
true
|
|
|
|
|
|
{{alias}}.REGEXP
|
|
Regular expression to parse a regular expression string.
|
|
|
|
Examples
|
|
--------
|
|
> var bool = {{alias}}.REGEXP.test( '/^beep$/' )
|
|
true
|
|
> bool = {{alias}}.REGEXP.test( '/boop' )
|
|
false
|
|
|
|
See Also
|
|
--------
|
|
|