I\'m new to Regex and I\'m trying to work it into one of my new projects to see if I can learn it and add it to my repitoire of skills. However, I\'m hitting a roadblock her
Building off of @Bohemian, I think the easiest approach would be to just use a regex literal, e.g.:
if (name.search(/[\[\]?*+|{}\\()@.\n\r]/) != -1) {
// ... stuff ...
}
Regex literals are nice because you don't have to escape the escape character, and some IDE's will highlight invalid regex (very helpful for me as I constantly screw them up).