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

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
--------