core
core copied to clipboard
Simplify RegEx for `SchedulerWithCache`
src/util/Scheduler/SchedulerWithCache.ts
contains a really large regular expression
https://github.com/translate-tools/core/blob/d8b6fbb156a8e03e0ee9d0be0a6e1879ceb1ad90/src/util/Scheduler/SchedulerWithCache.ts#L62
Let's replace it to a /[^\p{L}]/gu
and cover by tests.
Source: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions/Unicode_Property_Escapes
Unicode Property Escapes can be transpiled down to ES5 with a tool called regexpu
SO: https://stackoverflow.com/a/54879743/18680275