I've done it a million times in the past but for whatever reason I keep screwing up how to properly write a backslash (\) in a regular expression. Sometimes i spent a little time to solve it but the problems is i simply forget it at next times. It is wasting times trying to figure out why the character class in this
[\";:()\\[\\]<>@.\\,]
regular expression wouldn't match strings containing commas. I'm blogging the solution so I'll have a permanent record and hopefully, I'll once and for all stop screwing it up!
Solution:
[\";:()\\[\\]<>@.\\\\,]
notes: character '/' is treat as normal string "/", and character '\' as character '\\'
Subscribe to:
Post Comments (Atom)
Man Utd's next generation of wonderkids
Manchester United have set off on their pre-season United States tour with a number of young stars involved, but some other talents have lef...
-
My Team have won the best dressed Halloween competition for my company Halloween Annual Dinner last friday (2009-01-09). The winner prize is...
-
就让我为大家介绍一些这里的特色: 1. 泗里奎黄梨 泗里奎小镇对面岸的一个小岛,姆基湾多年来出产一种特种黄梨,当地人称她为泗里奎黄梨 (NENAS SARIKEI)。由于小岛土壤有限,泗里奎黄梨只够供应当地的市场,而没有外销,所以很多外地人都没有机会品尝到这种多汁的甜黄梨。目前这...
-
好 热的夜晚,没有一丝的风 又多蚊虫 不敢开窗换气 让人厌烦, 又是一个 难眠 的 夜晚 当结束一整天繁忙的工作时, 在静夜 惊醒时, 枕边已潮湿一片
No comments:
Post a Comment