You don't if you put your regexp into an edit field, i.e. when you use Validator interface for the custom checks you should use just \w, \d and \.sketch wrote:Why do you need two backslashes?
In JS, Java, C, C++ and many other programming languages we use a backslash as an escape character. Have a look at the Using special characters in strings at MDN.
Code: Select all
"regexp": "/this is a JS string, so we use \\w and \\. here/",