Regular expression to match a UTF-16 surrogate pair.
var reUtf16SurrogatePair = require( '@stdlib/regexp/utf16-surrogate-pair' );
Returns a regular expression to match a UTF-16 surrogate pair.
var RE_UTF16_SURROGATE_PAIR = reUtf16SurrogatePair();
var bool = RE_UTF16_SURROGATE_PAIR.test( 'abc\uD800\uDC00def' );
// returns true
Regular expression to match a UTF-16 surrogate pair.
var bool = reUtf16SurrogatePair.REGEXP.test( 'abc\uD800\uDC00def' );
// returns true
var reUtf16SurrogatePair = require( '@stdlib/regexp/utf16-surrogate-pair' );
var RE_UTF16_SURROGATE_PAIR = reUtf16SurrogatePair();
var bool = RE_UTF16_SURROGATE_PAIR.test( '\uD800\uDC00' );
// returns true
bool = RE_UTF16_SURROGATE_PAIR.test( 'abc\uD800\uDC00def' );
// returns true
bool = RE_UTF16_SURROGATE_PAIR.test( 'abc' );
// returns false
@stdlib/regexp/utf16-unpaired-surrogate
: return a regular expression to match an unpaired UTF-16 surrogate.