In #JavaScript, is it good practice to write bi-di #RegExp, e.g., to match prices /(€|£|₪|د.\ع)/g? Note the escaped '.'. TIA! (CC: @mathias)
-
-
Replying to @tomayac
@tomayac I’d suggest using escape sequences to keep the whole thing readable. http://mathiasbynens.be/notes/javascript-escapes …4 replies 0 retweets 0 likes -
Replying to @mathias
Thomas Steiner Retweeted Thomas Steiner
@mathias Now building the RegExp dynamically by joining the array from https://twitter.com/tomayac/status/405995880333209600 … on '|' and escaping '.', '$', '/'. Done :-)Thomas Steiner added,
Thomas Steiner @tomayacReplying to @mathias@mathias Bedankt, mate, this helped a ton: http://mothereff.in/js-escapes#1%5B%22%D8%8B%22%2C%20%22Ar%22%2C%20%22%E0%B8%BF%22%2C%20%22B%2F.%22%2C%20%22Br%22%2C%20%22Bs.%22%2C%20%22Bs.F.%22%2C%20%22GH%C2%A2%22%2C%20%22%C2%A2%22%2C%20%22c%22%2C%20%22ct%22%2C%20%22Ch.%22%2C%20%22%E2%82%A1%22%2C%20%22D%22%2C%20%22%D0%B4%D0%B5%D0%BD%22%2C%20%22%D8%AF%D8%AC%22%2C%20%22.%D8%AF.%D8%A8%22%2C%20%22%D8%AF.%D8%B9%22%2C%20%22JD%22%2C%20%22%D8%AF.%D9%83%22%2C%20%22%D9%84.%D8%AF%22%2C%20%22%D0%B4%D0%B8%D0%BD%22%2C%20%22%D8%AF.%D8%AA%22%2C%20%22%D8%AF.%D9%85.%22%2C%20%22%D8%AF.%D8%A5%22%2C%20%22Db%22%2C%20%22DEN%22%2C%20%22DA%22%2C%20%22BD%22%2C%20%22K.D.%22%2C%20%22LD%22%2C%20%22din.%22%2C%20%22DT%22%2C%20%22DH%22%2C%20%22Dhs%22%2C%20%22MOP%24%22%2C%20%22WS%24%22%2C%20%22CFA%22%2C%20%22F%22%2C%20%22RF%22%2C%20%22Rfr%22%2C%20%22CFA%22%2C%20%22%E2%82%ADN%22%2C%20%22%3A-%22%2C%20%22%2C-%22%2C%20%22L%22%2C%20%22m.%22%2C%20%22man.%22%2C%20%22KM%22%2C%20%22MTn%22%2C%20%22Nfa%22%2C%20%22%E5%9C%93%22%2C%20%22%E5%85%83%22%2C%20%22P%22%2C%20%22PhP%22%2C%20%22L%22%2C%20%22%E2%82%A4%22%2C%20%22L.E.%22%2C%20%22%C2%A3E%22%2C%20%22E%C2%A3%22%2C%20%22QR%22%2C%20%22rial%22%2C%20%22SR.%22%2C%20%22MRf.%22%2C%20%22MVR%22%2C%20%22%E2%82%B9%22%2C%20%22SR%22%2C%20%22KSh%22%2C%20%22Tk%22%2C%20%22T%22%2C%20%22ST%22%2C%20%22%E5%85%83%22%2C%20%22%D8%B1%DB%8C%D8%A7%D9%84%22%2C%20%22P%22%2C%20%22%24%22%2C%20%22%E2%82%AB%22%2C%20%22Esc%22%2C%20%22%E2%82%AC%22%2C%20%22%C6%92%22%2C%20%22Ft%22%2C%20%22FBu%22%2C%20%22FCFA%22%2C%20%22Fr%22%2C%20%22FRw%22%2C%20%22CFA%22%2C%20%22G%22%2C%20%22gr%22%2C%20%22%E2%82%B2%22%2C%20%22h%22%2C%20%22%E2%82%B4%22%2C%20%22%E2%82%AD%22%2C%20%22K%C4%8D%22%2C%20%22kr%22%2C%20%22kn%22%2C%20%22MK%22%2C%20%22ZK%22%2C%20%22Kz%22%2C%20%22K%22%2C%20%22%E1%83%9A%22%2C%20%22Ls%22%2C%20%22L%22%2C%20%22Le%22%2C%20%22E%22%2C%20%22lp%22%2C%20%22Lt%22%2C%20%22M%22%2C%20%22%D0%9A%D0%9C%22%2C%20%22MT%22%2C%20%22%E2%82%A5%22%2C%20%22Nfk%22%2C%20%22%E2%82%A6%22%2C%20%22Nu.%22%2C%20%22UM%22%2C%20%22MOP%24%22%2C%20%22%E2%82%B1%22%2C%20%22Pt.%22%2C%20%22%C2%A3%22%2C%20%22%D8%AC.%D9%85.%22%2C%20%22P%22%2C%20%22Q%22%2C%20%22q%22%2C%20%22R%22%2C%20%22R%24%22%2C%20%22%D8%B1%D9%8A%D8%A7%D9%84%22%2C%20%22%D8%B1.%D8%B9.%22%2C%20%22%D8%B1.%D9%82%22%2C%20%22%D8%B1.%D8%B3%22%2C%20%22%E1%9F%9B%22%2C%20%22RM%22%2C%20%22%D1%80.%22%2C%20%22Rf.%22%2C%20%22%E2%82%B9%22%2C%20%22INR%22%2C%20%22%E2%82%A8%22%2C%20%22%E2%82%A8%22%2C%20%22Rs%22%2C%20%22PKR%22%2C%20%22SRe%22%2C%20%22Rp%22%2C%20%22s%22%2C%20%22%E2%82%AA%22%2C%20%22Ksh%22%2C%20%22Sh.So.%22%2C%20%22USh%22%2C%20%22S%2F.%22%2C%20%22SDR%22%2C%20%22%D0%BB%D0%B2%22%2C%20%22%D1%81%D0%BE%D0%BC%22%2C%20%22%E0%A7%B3%22%2C%20%22WS%24%22%2C%20%22%E2%82%AE%22%2C%20%22VT%22%2C%20%22%E2%82%A9%22%2C%20%22%C2%A5%22%2C%20%22z%C5%82%22%2C%20%22%24%22%2C%20%22%E2%82%AC%22%5D …. If we ever meet, beers on me. Thanks for openly sharing your knowledge!2 replies 0 retweets 0 likes
Replying to @tomayac
@tomayac (http://vimeo.com/album/2588576/video/77508736 … for some more info on that)
1:51 AM - 28 Nov 2013
0 replies
0 retweets
0 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.