Closed pdubroy closed 2 years ago
The following does not work in Ohm, but probably should:
G { start = "\uD83D\uDE00"..""\uD83D\uDE00" }
This is equivalent, and doesn't work either:
G { start = "😀"..""😀" }
This code point is represented as a surrogate pair in JS, and should be treated like a single character.
We can use str.match(/./ug).length to check the number of code points:
str.match(/./ug).length
> '😀'.match(/./ug).length 1 > 'ab'.match(/./ug).length 2
The following does not work in Ohm, but probably should:
This is equivalent, and doesn't work either:
This code point is represented as a surrogate pair in JS, and should be treated like a single character.
We can use
str.match(/./ug).length
to check the number of code points: