I have a string that should be validated to be in the form of something like "Readdata.v5". What I do in my code, is I split the string based on the . (I check to make sure there is exactly one . in the string, so all other cases are handled). I want to validate it so that the first part of the string follows the format of a phrase, followed by any character to the period. The second part should start with the char v and then be followed by any number. This is the regex I have so far:
console.log("first field validation: " + splitArray[0].match(/^\"(Create|Read|Update|Delete)[a-zA-Z]*.$/));
console.log("Second field validation: " + splitArray[1].match(/^.vd+\"$/));
However, it doesn't seem like my regex is working. Did I make a mistake? The values in the array are correct, and split the values correctly (the quotations are a part of the string).
\d, notd..character shouldn't be included in your regex.