Hi, I am using below code snippet to validate my input string with: only capital letters, numbers and two special characters (those are & and Ñ) & without any space between.
var validpattern = new RegExp('[^A-Z0-9\d&Ñ]');
if (enteredID.match(validpattern))
isvalidChars = true;
else
isvalidChars = false;
Test 1: "XAXX0101%&&$#" should fail i.e isvalidChars = false; (as it contains invalid characters like %$#.
Test 2: "XAXX0101&Ñ3Ñ&" should pass.
Test 3: "XA 87B" should fail as it contains space in between
The above code is not working, Can any one help me rectifying the above regex.