@stdlib/regexp-utf16-surrogate-pair v0.2.2
reUtf16SurrogatePair
Regular expression to match a UTF-16 surrogate pair.
Installation
npm install @stdlib/regexp-utf16-surrogate-pair
Usage
var reUtf16SurrogatePair = require( '@stdlib/regexp-utf16-surrogate-pair' );
reUtf16SurrogatePair()
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
reUtf16SurrogatePair.REGEXP
Regular expression to match a UTF-16 surrogate pair.
var bool = reUtf16SurrogatePair.REGEXP.test( 'abc\uD800\uDC00def' );
// returns true
Examples
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
See Also
@stdlib/regexp-utf16-unpaired-surrogate
: return a regular expression to match an unpaired UTF-16 surrogate.
Notice
This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.
For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.
Community
License
See LICENSE.
Copyright
Copyright © 2016-2024. The Stdlib Authors.
6 months ago
11 months ago
11 months ago
1 year ago
1 year ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago