A
A
Alex2019-06-21 17:44:40
JavaScript
Alex, 2019-06-21 17:44:40

What's the regex problem in Firefox?

There is a regular expression that clears the line: It works in chrome, but in Firefox I get an error:
'hello World'.replace(/[^\p{L}]/ug, '')

SyntaxError: invalid identity escape in regular expression

How to be?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lynn "Coffee Man", 2019-06-21
@Kozack

Firefox does not yet know such expressions.
https://bugzilla.mozilla.org/show_bug.cgi?id=1361876
Use some transpiler
https://github.com/tc39/proposal-regexp-unicode-pr...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question