repl.txt (1071B)
1 2 {{alias}}( [options] ) 3 Regular expression to match a newline character sequence: /\r?\n/. 4 5 Parameters 6 ---------- 7 options: Object (optional) 8 Options. 9 10 options.flags: string (optional) 11 Regular expression flags. Default: ''. 12 13 options.capture: boolean (optional) 14 Boolean indicating whether to create a capture group for the match. 15 Default: false. 16 17 Returns 18 ------- 19 regexp: RegExp 20 Regular expression. 21 22 Examples 23 -------- 24 > var RE_EOL = {{alias}}(); 25 > var bool = RE_EOL.test( '\n' ) 26 true 27 > bool = RE_EOL.test( '\r\n' ) 28 true 29 > bool = RE_EOL.test( '\\r\\n' ) 30 false 31 32 {{alias}}.REGEXP 33 Regular expression to match a newline character sequence: /\r?\n/. 34 35 Examples 36 -------- 37 > var bool = {{alias}}.REGEXP.test( 'abc' ) 38 false 39 40 {{alias}}.REGEXP_CAPTURE 41 Regular expression to capture a newline character sequence: /\r?\n/. 42 43 Examples 44 -------- 45 > var parts = {{alias}}.REGEXP_CAPTURE.exec( '\n' ) 46 [ '\n', '\n' ] 47 48 See Also 49 -------- 50