Didn’t know this JS feature. Widely supported. But: global & not ES5 ⇒ avoid. > if (/^-([^-]*)-$/.test('-abc-‘)) console.log(RegExp.$1) abc
Replying to @rauschma
@rauschma https://javascript.spec.whatwg.org/#regexp.$n — still needs a proper definition in spec prose, though.
0 replies
1 retweet
2 likes
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.