In #JavaScript, is it good practice to write bi-di #RegExp, e.g., to match prices /(€|£|₪|د.\ع)/g? Note the escaped '.'. TIA! (CC: @mathias)
@tomayac Sounds good. Might be useful to do this as part of a build script (e.g. `create-regex.js`) rather than at run-time.
-
-
@mathias I do it once & recycle the RegExp. Of course banged my head b/o https://twitter.com/tomayac/status/405297970981400576 …. Now resetting lastIndex each time & works. -
@tomayac You do it once, but still at runtime? - 3 more replies
New conversation -
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.