Emoji_Component.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. // Copyright 2019 Mathias Bynens. All rights reserved.
  2. // This code is governed by the BSD license found in the LICENSE file.
  3. /*---
  4. author: Mathias Bynens
  5. description: >
  6. Unicode property escapes for `Emoji_Component`
  7. info: |
  8. Generated by https://github.com/mathiasbynens/unicode-property-escapes-tests
  9. Unicode v12.1.0
  10. esid: sec-static-semantics-unicodematchproperty-p
  11. features: [regexp-unicode-property-escapes]
  12. includes: [regExpUtils.js]
  13. ---*/
  14. const matchSymbols = buildString({
  15. loneCodePoints: [
  16. 0x000023,
  17. 0x00002A,
  18. 0x00200D,
  19. 0x0020E3,
  20. 0x00FE0F
  21. ],
  22. ranges: [
  23. [0x000030, 0x000039],
  24. [0x01F1E6, 0x01F1FF],
  25. [0x01F3FB, 0x01F3FF],
  26. [0x01F9B0, 0x01F9B3],
  27. [0x0E0020, 0x0E007F]
  28. ]
  29. });
  30. testPropertyEscapes(
  31. /^\p{Emoji_Component}+$/u,
  32. matchSymbols,
  33. "\\p{Emoji_Component}"
  34. );
  35. const nonMatchSymbols = buildString({
  36. loneCodePoints: [],
  37. ranges: [
  38. [0x00DC00, 0x00DFFF],
  39. [0x000000, 0x000022],
  40. [0x000024, 0x000029],
  41. [0x00002B, 0x00002F],
  42. [0x00003A, 0x00200C],
  43. [0x00200E, 0x0020E2],
  44. [0x0020E4, 0x00DBFF],
  45. [0x00E000, 0x00FE0E],
  46. [0x00FE10, 0x01F1E5],
  47. [0x01F200, 0x01F3FA],
  48. [0x01F400, 0x01F9AF],
  49. [0x01F9B4, 0x0E001F],
  50. [0x0E0080, 0x10FFFF]
  51. ]
  52. });
  53. testPropertyEscapes(
  54. /^\P{Emoji_Component}+$/u,
  55. nonMatchSymbols,
  56. "\\P{Emoji_Component}"
  57. );