File: repl.txt

package info (click to toggle)
node-stdlib 0.0.96%2Bds1%2B~cs0.0.429-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 421,476 kB
  • sloc: javascript: 1,562,831; ansic: 109,702; lisp: 49,823; cpp: 27,224; python: 7,871; sh: 6,807; makefile: 6,089; fortran: 3,102; awk: 387
file content (83 lines) | stat: -rw-r--r-- 1,907 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83

{{alias}}( [platform] )
    Regular expression to split a filename.

    The regular expression is platform-dependent. If the current process is
    running on Windows, the regular expression is `*.REGEXP_WIN32`; otherwise,
    `*.REGEXP_POSIX`.

    Parameters
    ----------
    platform: string (optional)
        Path platform (either `posix` or `win32`).

    Returns
    -------
    re: RegExp
        Regular expression.

    Examples
    --------
    > var RE = {{alias}}()
    <RegExp>
    > var RE_POSIX = {{alias}}( 'posix' );
    > var parts = RE_POSIX.exec( '/foo/bar/index.js' ).slice()
    <Array>
    > var RE_WIN32 = {{alias}}( 'win32' );
    > parts = RE.exec( 'C:\\foo\\bar\\index.js' ).slice()
    <Array>
    > var str = RE.toString();
    > var bool = ( str === RE_POSIX.toString() || str === RE_WIN32.toString() )
    true


{{alias}}.REGEXP
    Regular expression to split a filename.

    Examples
    --------
    > var RE = {{alias}}.REGEXP
    <RegExp>


{{alias}}.REGEXP_POSIX
    Regular expression to split a POSIX filename.

    When executed, the regular expression splits a POSIX filename into the
    following parts:

    - input value
    - root
    - dirname
    - basename
    - extname

    Examples
    --------
    > var f = '/foo/bar/index.js';
    > var parts = {{alias}}.REGEXP_POSIX.exec( f ).slice()
    [ '/foo/bar/index.js', '/', 'foo/bar/', 'index.js', '.js' ]


{{alias}}.REGEXP_WIN32
    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

    Examples
    --------
    > var f = 'C:\\foo\\bar\\index.js';
    > var parts = {{alias}}.REGEXP_WIN32.exec( f ).slice()
    [ 'C:\\foo\\bar\\index.js', 'C:', '\\', 'foo\\bar\\', 'index.js', '.js' ]

    See Also
    --------