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. I wasted 20+ minutes yesterday 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:
[\";:()\\[\\]<>@.\\\\,]
Your note has been very helpful. Thanks!
ReplyDeleteYou saved me a huge amount of time there. Thanks!
ReplyDelete/J in Sweden