45 lines
958 B
Plaintext
45 lines
958 B
Plaintext
|
|
||
|
{{alias}}
|
||
|
Returns a regular expression to capture a POSIX filename extension.
|
||
|
|
||
|
When executed against dotfile filenames (e.g., `.gitignore`), the regular
|
||
|
expression does not capture the basename as a filename extension.
|
||
|
|
||
|
Returns
|
||
|
-------
|
||
|
re: RegExp
|
||
|
Regular expression.
|
||
|
|
||
|
Examples
|
||
|
--------
|
||
|
> var RE = {{alias}}();
|
||
|
> var ext = RE.exec( '/foo/bar/index.js' )[ 1 ]
|
||
|
'.js'
|
||
|
> ext = RE.exec( './foo/bar/.gitignore' )[ 1 ]
|
||
|
''
|
||
|
> ext = RE.exec( 'foo/file.pdf' )[ 1 ]
|
||
|
'.pdf'
|
||
|
> ext = RE.exec( '/foo/bar/file' )[ 1 ]
|
||
|
''
|
||
|
> ext = RE.exec( 'index.js' )[ 1 ]
|
||
|
'.js'
|
||
|
> ext = RE.exec( '.' )[ 1 ]
|
||
|
''
|
||
|
> ext = RE.exec( './' )[ 1 ]
|
||
|
''
|
||
|
> ext = RE.exec( '' )[ 1 ]
|
||
|
''
|
||
|
|
||
|
|
||
|
{{alias}}.REGEXP
|
||
|
Regular expression to capture a POSIX filename extension.
|
||
|
|
||
|
Examples
|
||
|
--------
|
||
|
> var ext = {{alias}}.REGEXP.exec( '/foo/bar/index.js' )[ 1 ]
|
||
|
'.js'
|
||
|
|
||
|
See Also
|
||
|
--------
|
||
|
|