Thanks for taking the time to answer my question.
I want to check if a string has exactly 7 characters and starts with \"1234\". How do I do that?
I know of
Simple RegExp:
var isMatch = /^1234...$/.test(myString);
Or:
var isMatch = myString.length == 7 && myString.indexOf("1234") == 0;
Edit: Or:
var isMatch = myString.length == 7 && myString.substr(0, 4) == "1234";