| 1 |
// Copyright 2017 Mathias Bynens. All rights reserved. |
| 2 |
// This code is governed by the BSD license found in the LICENSE file. |
| 3 |
|
| 4 |
/*--- |
| 5 |
author: Mathias Bynens |
| 6 |
description: > |
| 7 |
Unicode property escapes for `Ideographic` |
| 8 |
info: | |
| 9 |
Generated by https://github.com/mathiasbynens/unicode-property-escapes-tests |
| 10 |
Unicode v10.0.0 |
| 11 |
Emoji v5.0 (UTR51) |
| 12 |
esid: sec-static-semantics-unicodematchproperty-p |
| 13 |
features: [regexp-unicode-property-escapes] |
| 14 |
includes: [regExpUtils.js] |
| 15 |
---*/ |
| 16 |
|
| 17 |
const matchSymbols = buildString({ |
| 18 |
loneCodePoints: [], |
| 19 |
ranges: [ |
| 20 |
[0x003006, 0x003007], |
| 21 |
[0x003021, 0x003029], |
| 22 |
[0x003038, 0x00303A], |
| 23 |
[0x003400, 0x004DB5], |
| 24 |
[0x004E00, 0x009FEA], |
| 25 |
[0x00F900, 0x00FA6D], |
| 26 |
[0x00FA70, 0x00FAD9], |
| 27 |
[0x017000, 0x0187EC], |
| 28 |
[0x018800, 0x018AF2], |
| 29 |
[0x01B170, 0x01B2FB], |
| 30 |
[0x020000, 0x02A6D6], |
| 31 |
[0x02A700, 0x02B734], |
| 32 |
[0x02B740, 0x02B81D], |
| 33 |
[0x02B820, 0x02CEA1], |
| 34 |
[0x02CEB0, 0x02EBE0], |
| 35 |
[0x02F800, 0x02FA1D] |
| 36 |
] |
| 37 |
}); |
| 38 |
testPropertyEscapes( |
| 39 |
/^\p{Ideographic}+$/u, |
| 40 |
matchSymbols, |
| 41 |
"\\p{Ideographic}" |
| 42 |
); |
| 43 |
testPropertyEscapes( |
| 44 |
/^\p{Ideo}+$/u, |
| 45 |
matchSymbols, |
| 46 |
"\\p{Ideo}" |
| 47 |
); |
| 48 |
|
| 49 |
const nonMatchSymbols = buildString({ |
| 50 |
loneCodePoints: [], |
| 51 |
ranges: [ |
| 52 |
[0x00DC00, 0x00DFFF], |
| 53 |
[0x000000, 0x003005], |
| 54 |
[0x003008, 0x003020], |
| 55 |
[0x00302A, 0x003037], |
| 56 |
[0x00303B, 0x0033FF], |
| 57 |
[0x004DB6, 0x004DFF], |
| 58 |
[0x009FEB, 0x00DBFF], |
| 59 |
[0x00E000, 0x00F8FF], |
| 60 |
[0x00FA6E, 0x00FA6F], |
| 61 |
[0x00FADA, 0x016FFF], |
| 62 |
[0x0187ED, 0x0187FF], |
| 63 |
[0x018AF3, 0x01B16F], |
| 64 |
[0x01B2FC, 0x01FFFF], |
| 65 |
[0x02A6D7, 0x02A6FF], |
| 66 |
[0x02B735, 0x02B73F], |
| 67 |
[0x02B81E, 0x02B81F], |
| 68 |
[0x02CEA2, 0x02CEAF], |
| 69 |
[0x02EBE1, 0x02F7FF], |
| 70 |
[0x02FA1E, 0x10FFFF] |
| 71 |
] |
| 72 |
}); |
| 73 |
testPropertyEscapes( |
| 74 |
/^\P{Ideographic}+$/u, |
| 75 |
nonMatchSymbols, |
| 76 |
"\\P{Ideographic}" |
| 77 |
); |
| 78 |
testPropertyEscapes( |
| 79 |
/^\P{Ideo}+$/u, |
| 80 |
nonMatchSymbols, |
| 81 |
"\\P{Ideo}" |
| 82 |
); |