time-to-botec/js/node_modules/@stdlib/regexp/extname-windows/docs/repl.txt
NunoSempere b6addc7f05 feat: add the node modules
Necessary in order to clearly see the squiggle hotwiring.
2022-12-03 12:44:49 +00:00

43 lines
951 B
Plaintext

{{alias}}
Returns a regular expression to capture a Windows 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( 'C:\\foo\\bar\\index.js' )[ 1 ]
'.js'
> ext = RE.exec( 'C:\\foo\\bar\\.gitignore' )[ 1 ]
''
> ext = RE.exec( 'foo\\file.pdf' )[ 1 ]
'.pdf'
> ext = RE.exec( '\\foo\\bar\\file' )[ 1 ]
''
> ext = RE.exec( 'beep\\boop.' )[ 1 ]
'.'
> ext = RE.exec( 'index.js' )[ 1 ]
'.js'
> ext = RE.exec( '' )[ 1 ]
''
{{alias}}.REGEXP
Regular expression to capture a Windows filename extension.
Examples
--------
> var ext = {{alias}}.REGEXP.exec( 'C:\\foo\\bar\\index.js' )[ 1 ]
'.js'
See Also
--------