time-to-botec/js/node_modules/@stdlib/regexp/filename-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

54 lines
1.6 KiB
Plaintext

{{alias}}()
Returns a regular expression to split a Windows filename.
When executed, the regular expression splits a Windows filename into the
following parts:
- input value
- device
- slash
- dirname
- basename
- extname
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 parts = RE.exec( 'C:\\foo\\bar\\index.js' ).slice()
[ 'C:\\foo\\bar\\index.js', 'C:', '\\', 'foo\\bar\\', 'index.js', '.js' ]
> parts = RE.exec( '\\foo\\bar\\.gitignore' ).slice()
[ '\\foo\\bar\\.gitignore', '', '\\', 'foo\\bar\\', '.gitignore', '' ]
> parts = RE.exec( 'foo\\file.pdf' ).slice()
[ 'foo\\file.pdf', '', '', 'foo\\', 'file.pdf', '.pdf' ]
> parts = RE.exec( '\\foo\\bar\\file' ).slice()
[ '\\foo\\bar\\file', '', '\\', 'foo\\bar\\', 'file', '' ]
> parts = RE.exec( 'index.js' ).slice()
[ 'index.js', '', '', '', 'index.js', '.js' ]
> parts = RE.exec( '.' ).slice()
[ '.', '', '', '', '.', '' ]
> parts = RE.exec( './' ).slice()
[ './', '', ..., '.', '' ]
> parts = RE.exec( '' ).slice()
[ '', '', '', '', '', '' ]
{{alias}}.REGEXP
Regular expression to split a Windows filename.
Examples
--------
> var parts = {{alias}}.REGEXP.exec( 'C:\\foo\\bar\\index.js' ).slice()
[ 'C:\\foo\\bar\\index.js', 'C:', '\\', 'foo\\bar\\', 'index.js', '.js' ]
See Also
--------