Regular expression to match a newline character sequence.
var RE_EOL = require( '@stdlib/regexp/eol' );
Regular expression to match a newline character sequence.
var bool = RE_EOL.test( '\n' );
// returns true
bool = RE_EOL.test( '\r\n' );
// returns true
bool = RE_EOL.test( '\\r\\n' );
// returns false
var RE_EOL = require( '@stdlib/regexp/eol' );
var bool;
var str;
bool = RE_EOL.test( '\r\n' );
// returns true
bool = RE_EOL.test( '\n' );
// returns true
bool = RE_EOL.test( '\r' );
// returns false
bool = RE_EOL.test( '\\r\\n' );
// returns false
bool = RE_EOL.test( 'beep' );
// returns false
str = 'This is\na newline\r\ndelimited string.';
var arr = str.split( RE_EOL );
// returns [ 'This is', 'a newline', 'delimited string.' ]