time-to-botec

Benchmark sampling in different programming languages
Log | Files | Refs | README

repl.txt (1610B)


      1 
      2 {{alias}}()
      3     Returns a regular expression to split a Windows filename.
      4 
      5     When executed, the regular expression splits a Windows filename into the
      6     following parts:
      7 
      8     - input value
      9     - device
     10     - slash
     11     - dirname
     12     - basename
     13     - extname
     14 
     15     When executed against dotfile filenames (e.g., `.gitignore`), the regular
     16     expression does not capture the basename as a filename extension.
     17 
     18     Returns
     19     -------
     20     re: RegExp
     21         Regular expression.
     22 
     23     Examples
     24     --------
     25     > var RE = {{alias}}();
     26     > var parts = RE.exec( 'C:\\foo\\bar\\index.js' ).slice()
     27     [ 'C:\\foo\\bar\\index.js', 'C:', '\\', 'foo\\bar\\', 'index.js', '.js' ]
     28     > parts = RE.exec( '\\foo\\bar\\.gitignore' ).slice()
     29     [ '\\foo\\bar\\.gitignore', '', '\\', 'foo\\bar\\', '.gitignore', '' ]
     30     > parts = RE.exec( 'foo\\file.pdf' ).slice()
     31     [ 'foo\\file.pdf', '', '', 'foo\\', 'file.pdf', '.pdf' ]
     32     > parts = RE.exec( '\\foo\\bar\\file' ).slice()
     33     [ '\\foo\\bar\\file', '', '\\', 'foo\\bar\\', 'file', '' ]
     34     > parts = RE.exec( 'index.js' ).slice()
     35     [ 'index.js', '', '', '', 'index.js', '.js' ]
     36     > parts = RE.exec( '.' ).slice()
     37     [ '.', '', '', '', '.', '' ]
     38     > parts = RE.exec( './' ).slice()
     39     [ './', '', ..., '.', '' ]
     40     > parts = RE.exec( '' ).slice()
     41     [ '', '', '', '', '', '' ]
     42 
     43 
     44 {{alias}}.REGEXP
     45     Regular expression to split a Windows filename.
     46 
     47     Examples
     48     --------
     49     > var parts = {{alias}}.REGEXP.exec( 'C:\\foo\\bar\\index.js' ).slice()
     50     [ 'C:\\foo\\bar\\index.js', 'C:', '\\', 'foo\\bar\\', 'index.js', '.js' ]
     51 
     52     See Also
     53     --------