You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here are the rules for my string and would like to see what methods I need to use that would work with this library.
Must be LNLNLN where L = letter and N = number. So for example A8B9L7 would be valid but AA88HH would not be.
Must be 6 digits only.
Must not have a Z or W in the first position but they are okay in the other positions.
Can not have D,F,I,O,Q,U, letters in any position.
I would pass an upper case version of the letter to the function to verify so only A-Z apply and doesn't need case sensitivity.
Must give true if it passes all of these.
Now if I pass
899098 - should fail
Z9F0N8 - should fail because of the Z in first position
W9F0N8 - should fail because of the W in first position.
V9F5L2 - should fail because of the F - not allowed anywhere - includes the D,I,O,Q, and U letters as well.
V9H7 - should fail - not long enough
C0T0R6V - should fail because it is too long.
1G2G3G - should fail - numbers and letter are not in the right places.
A9Z6J8 - this should pass as Z is not in the first position. Same for W.
M8K8E6 - Should pass
The current alternating pattern I'm using is /^[A-Z][0-9][A-Z][0-9][A-Z][0-9]+$/.test(value)
however I have to say that I have a lot of pre-processing that I'm doing before it gets there - ie turning to uppercase, ensuring Z and W is not in the first position, removing all non alphanumeric stuff along with non valid letters,, and so on. Just including it here as it may help.
May have to break things up into two separate calls to verbal expressions if that would work better.
The text was updated successfully, but these errors were encountered:
Here are the rules for my string and would like to see what methods I need to use that would work with this library.
Now if I pass
899098 - should fail
Z9F0N8 - should fail because of the Z in first position
W9F0N8 - should fail because of the W in first position.
V9F5L2 - should fail because of the F - not allowed anywhere - includes the D,I,O,Q, and U letters as well.
V9H7 - should fail - not long enough
C0T0R6V - should fail because it is too long.
1G2G3G - should fail - numbers and letter are not in the right places.
A9Z6J8 - this should pass as Z is not in the first position. Same for W.
M8K8E6 - Should pass
The current alternating pattern I'm using is /^[A-Z][0-9][A-Z][0-9][A-Z][0-9]+$/.test(value)
however I have to say that I have a lot of pre-processing that I'm doing before it gets there - ie turning to uppercase, ensuring Z and W is not in the first position, removing all non alphanumeric stuff along with non valid letters,, and so on. Just including it here as it may help.
May have to break things up into two separate calls to verbal expressions if that would work better.
The text was updated successfully, but these errors were encountered: