I've been trying out different regexes but I can't seem to find the correct one.
I need an regex which allows users to type alphabetic, digits, spaces, - and ' in texts.
So strings like: "'s Ochtends vroeg" "tomorrow-night" "ISBN1234ABC"
should be true.
I've tried the following regexes with the following code:
/([A-Za-z0-9'-\s])/g
[^#$@_&!*()]
and more of these variations
var regex = new RegExp("([a-zA-Z0-9\s'-])+");
console.log(regex.test(word));
All return true now, when I type in the word: "ABN##@@123-TEST". It should be false because the characters ##@@ are in it.
Thanks for your help.