Script_-_Hangul.js (2119B)
1 // Copyright 2025 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 `Script=Hangul` 8 info: | 9 Generated by https://github.com/mathiasbynens/unicode-property-escapes-tests 10 Unicode v17.0.0 11 esid: sec-static-semantics-unicodematchproperty-p 12 features: [regexp-unicode-property-escapes] 13 includes: [regExpUtils.js] 14 ---*/ 15 16 const matchSymbols = buildString({ 17 loneCodePoints: [], 18 ranges: [ 19 [0x001100, 0x0011FF], 20 [0x00302E, 0x00302F], 21 [0x003131, 0x00318E], 22 [0x003200, 0x00321E], 23 [0x003260, 0x00327E], 24 [0x00A960, 0x00A97C], 25 [0x00AC00, 0x00D7A3], 26 [0x00D7B0, 0x00D7C6], 27 [0x00D7CB, 0x00D7FB], 28 [0x00FFA0, 0x00FFBE], 29 [0x00FFC2, 0x00FFC7], 30 [0x00FFCA, 0x00FFCF], 31 [0x00FFD2, 0x00FFD7], 32 [0x00FFDA, 0x00FFDC] 33 ] 34 }); 35 testPropertyEscapes( 36 /^\p{Script=Hangul}+$/u, 37 matchSymbols, 38 "\\p{Script=Hangul}" 39 ); 40 testPropertyEscapes( 41 /^\p{Script=Hang}+$/u, 42 matchSymbols, 43 "\\p{Script=Hang}" 44 ); 45 testPropertyEscapes( 46 /^\p{sc=Hangul}+$/u, 47 matchSymbols, 48 "\\p{sc=Hangul}" 49 ); 50 testPropertyEscapes( 51 /^\p{sc=Hang}+$/u, 52 matchSymbols, 53 "\\p{sc=Hang}" 54 ); 55 56 const nonMatchSymbols = buildString({ 57 loneCodePoints: [], 58 ranges: [ 59 [0x00DC00, 0x00DFFF], 60 [0x000000, 0x0010FF], 61 [0x001200, 0x00302D], 62 [0x003030, 0x003130], 63 [0x00318F, 0x0031FF], 64 [0x00321F, 0x00325F], 65 [0x00327F, 0x00A95F], 66 [0x00A97D, 0x00ABFF], 67 [0x00D7A4, 0x00D7AF], 68 [0x00D7C7, 0x00D7CA], 69 [0x00D7FC, 0x00DBFF], 70 [0x00E000, 0x00FF9F], 71 [0x00FFBF, 0x00FFC1], 72 [0x00FFC8, 0x00FFC9], 73 [0x00FFD0, 0x00FFD1], 74 [0x00FFD8, 0x00FFD9], 75 [0x00FFDD, 0x10FFFF] 76 ] 77 }); 78 testPropertyEscapes( 79 /^\P{Script=Hangul}+$/u, 80 nonMatchSymbols, 81 "\\P{Script=Hangul}" 82 ); 83 testPropertyEscapes( 84 /^\P{Script=Hang}+$/u, 85 nonMatchSymbols, 86 "\\P{Script=Hang}" 87 ); 88 testPropertyEscapes( 89 /^\P{sc=Hangul}+$/u, 90 nonMatchSymbols, 91 "\\P{sc=Hangul}" 92 ); 93 testPropertyEscapes( 94 /^\P{sc=Hang}+$/u, 95 nonMatchSymbols, 96 "\\P{sc=Hang}" 97 ); 98 99 reportCompare(0, 0);