time-to-botec/squiggle/node_modules/@stdlib/regexp/basename-posix/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

42 lines
995 B
Plaintext

{{alias}}()
Returns a regular expression to capture the last part of a POSIX path.
Returns
-------
re: RegExp
Regular expression.
Examples
--------
> var RE_BASENAME_POSIX = {{alias}}();
> var base = RE_BASENAME_POSIX.exec( '/foo/bar/index.js' )[ 1 ]
'index.js'
> base = RE_BASENAME_POSIX.exec( './foo/bar/.gitignore' )[ 1 ]
'.gitignore'
> base = RE_BASENAME_POSIX.exec( 'foo/file.pdf' )[ 1 ]
'file.pdf'
> base = RE_BASENAME_POSIX.exec( '/foo/bar/file' )[ 1 ]
'file'
> base = RE_BASENAME_POSIX.exec( 'index.js' )[ 1 ]
'index.js'
> base = RE_BASENAME_POSIX.exec( '.' )[ 1 ]
'.'
> base = RE_BASENAME_POSIX.exec( './' )[ 1 ]
'.'
> base = RE_BASENAME_POSIX.exec( '' )[ 1 ]
''
{{alias}}.REGEXP
Regular expression to capture the last part of a POSIX path.
Examples
--------
> var base = {{alias}}.REGEXP.exec( 'foo/bar/index.js' )[ 1 ]
'index.js'
See Also
--------