I was trying to write a regex that accetps a string that has atleast 1 number 1 alphabet and 1 special character ,
/^[a-zA-Z][a-zA-Z][@#$%^& .. and a bu
You can use lookaheads:
/^(?=.*?[a-z])(?=.*?\d)(?=.*?[...])/i
[...]
should hold the special characters you want.
var item = "1a$";
item.match(/^[0-9][a-zA-Z][^a-zA-Z0-9\s\t\n]$/)
That should work
You can use 3 little regex to accomplish that easily (it's more readable) :