@rauschma in JS for impatient programmers and Exploring ES6 there is no mention that adding the u flag to a regex will cause an exception to be thrown on an unreserved or unused escape sequence, where the escape would just be ignored before.
-
Show this thread
-
I struggled to find the cause of an thrown exception when I enabled the u flag on a regex. Reviewing Exploring ES6 suggested no leads, so I ended up going down other rabbit holes.
1 reply 0 retweets 0 likesShow this thread -
@mathias provided the answer in https://mathiasbynens.be/notes/es6-unicode-regex#impact-syntax …: "So even though /\a/ is treated as /a/, /\a/u throws an error, because \a is not a reserved escape sequence."1 reply 0 retweets 1 likeShow this thread
Replying to @zeorin
I like to think of the `u` flag as a “strict mode” for regular expressions.
2:53 AM - 13 Feb 2019
0 replies
0 retweets
1 like
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.