surrogatePairsReg top-level property

RegExp surrogatePairsReg
getter/setter pair

A regular expression that matches UTF-16 surrogate pairs.

This is used to detect characters represented by surrogate pairs in UTF-16, which includes many emoji, rare Chinese characters, and other supplementary Unicode characters (i.e., characters with code points above U+FFFF).

Surrogate pairs are made up of:

  • A high surrogate: \uD800\uDBFF
  • A low surrogate: \uDC00\uDFFF

Example matches:

  • Emoji: 😀 (U+1F600)
  • Rare characters: 𠀋 (U+2000B)

Implementation

RegExp surrogatePairsReg = RegExp(surrogatePairsRegStr);