I am trying to write the regex for CC-YY-NNNN(PE-19-001). Where CC is a character, YY is the year NNNN could be a 3 or a 4 digit positive number. There will be exactly two dashes in the string.
So far, what I have tried is :
if( value.includes("-") && /\d/.test(value) && /[a-zA-Z]/.test(value) && /-\d$/.test('-1') )
But I am unable to get any close.