How to find client ES6 Unicode DB version when https://github.com/tc39/proposal-regexp-unicode-property-escapes … [cc @mathias]
alert('ªༀඅऄॻॳॸૹಀৼ'.match(/^\p{Lo}*/u)[0].length + '.0')
-
-
Replying to @FakeUnicode
Clever! Annotated version: https://mothereff.in/regexpu#input=%2F%2F+https%3A%2F%2Ftwitter.com%2FFakeUnicode%2Fstatus%2F818358646396436480%0Aconst+getUnicodeVersion+%3D+%28%29+%3D%3E+%7B%0A++%2F%2F+Note%3A+this+solution+works+for+Unicode+versions+up+until+v10.0.0.%0A++%2F%2F+This+string+contains+1+new+%60Lo%60+character+for+every+Unicode+version.%0A++const+string+%3D+%27%5CxAA%5Cu093D%5Cu06B8%5Cu0904%5Cu0294%5Cu0620%5Cu08A1%5Cu08B3%5Cu08B6%5Cu09FC%27%3B%0A++%2F%2F++++++version+1+++2+++++3+++++4+++++5+++++6+++++7+++++8+++++9+++++10%0A++%2F%2F+https%3A%2F%2Fgist.github.com%2Fmathiasbynens%2Fcfbf37892bd3142e70bb682a57964240%0A++const+regex+%3D+%2F%5E%5Cp%7BLo%7D%7B1%2C10%7D%2Fu%3B%0A++return+string.match%28regex%29%5B0%5D.length+%2B+%27.0.0%27%3B%0A%7D%3B%0Aconsole.log%28getUnicodeVersion%28%29%29%3B&unicodePropertyEscape=1 … You could even detect Unicode v5.1.0 vs. v5.2.0 using this technique.
1 reply 4 retweets 4 likes -
Replying to @mathias
Yeah, I was only going for integer revisions so it would fit in a tweet. Which is all that Unicode seems to do anymore anyway.
1 reply 0 retweets 0 likes -
Replying to @FakeUnicode @mathias
(And it seems highly unlikely anything implementing ES6 \p would use a Unicode database older than 6.3)
1 reply 0 retweets 0 likes
True — it would also be a spec violation per https://github.com/tc39/ecma262/pull/620 ….
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
JavaScript, HTML, CSS, HTTP, performance, security, Bash, Unicode, i18n, macOS.