question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Closure compiler doesn't recognize `\u{XXXX}` in regular expression

See original GitHub issue

The following code:

let x = /\u{ffff}/u;

would yield:

WARNING - [JSC_MALFORMED_REGEXP] Malformed Regular Expression: {ffff}

from closure compiler, but it’s a valid regular expression, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions/Character_Classes

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
blicklycommented, May 27, 2020

Sounds good. Thanks!

I stand by my advice in https://github.com/google/closure-compiler/issues/3563#issuecomment-593548756 on where I’d recommend starting.

1reaction
blicklycommented, Mar 2, 2020

Sure, the parsing package is the right place to look. I’d start with a unit test in: https://github.com/google/closure-compiler/blob/master/test/com/google/javascript/jscomp/parsing/ParserTest.java

Read more comments on GitHub >

github_iconTop Results From Across the Web

Support for ES2018 Regular Expressions · Issue #3028 - GitHub
We've done all we plan to do for supporting the RegExp features added in ES_2018 . closure-compiler will recognize them and not choke...
Read more >
javascript - Regular expression to match non-ASCII characters?
This should do it: [^\x00-\x7F]+. It matches any character which is not contained in the ASCII character set (0-127, i.e. 0x0 to 0x7F)....
Read more >
New src/share/classes/java/util/regex/Pattern.java
40 * 41 * <p> A regular expression, specified as a string, must first be compiled into 42 * an instance of this...
Read more >
A tour of the Dart language
This page shows you how to use each major Dart feature, from variables and operators to classes and libraries, with the assumption that...
Read more >
Changelog for Groovy 1.0.0
does not work properly; [GROOVY-1072] - void.class is not recognized by groovy ... regex support; [GROOVY-613] - global properties referenced from closure ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found