time-to-botec

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

repl.txt (1439B)


      1 
      2 {{alias}}( [platform] )
      3     Returns a regular expression to capture a path dirname.
      4 
      5     The regular expression is platform-dependent. If the current process is
      6     running on Windows, the regular expression is `*.REGEXP_WIN32`; otherwise,
      7     `*.REGEXP_POSIX`.
      8 
      9     Parameters
     10     ----------
     11     platform: string (optional)
     12         Path platform (either `posix` or `win32`).
     13 
     14     Returns
     15     -------
     16     re: RegExp
     17         Regular expression.
     18 
     19     Examples
     20     --------
     21     > var RE = {{alias}}()
     22     <RegExp>
     23     > var RE_POSIX = {{alias}}( 'posix' );
     24     > var dir = RE_POSIX.exec( '/foo/bar/index.js' )[ 1 ]
     25     '/foo/bar'
     26     > var RE_WIN32 = {{alias}}( 'win32' );
     27     > dir = RE_WIN32.exec( 'C:\\foo\\bar\\index.js' )[ 1 ]
     28     'C:\\foo\\bar'
     29     > var str = RE.toString();
     30     > var bool = ( str === RE_POSIX.toString() || str === RE_WIN32.toString() )
     31     true
     32 
     33 
     34 {{alias}}.REGEXP
     35     Regular expression to capture a path dirname.
     36 
     37     Examples
     38     --------
     39     > var RE = {{alias}}.REGEXP
     40     <RegExp>
     41 
     42 
     43 {{alias}}.REGEXP_POSIX
     44     Regular expression to capture a POSIX path dirname.
     45 
     46     Examples
     47     --------
     48     > var dir = {{alias}}.REGEXP_POSIX.exec( '/foo/bar/index.js' )[ 1 ]
     49     '/foo/bar'
     50 
     51 
     52 {{alias}}.REGEXP_WIN32
     53     Regular expression to capture a Windows path dirname.
     54 
     55     Examples
     56     --------
     57     > var dir = {{alias}}.REGEXP_WIN32.exec( 'C:\\foo\\bar\\index.js' )[ 1 ]
     58     'C:\\foo\\bar'
     59 
     60     See Also
     61     --------
     62