I am trying to write a regex pattern check to check if my string starts with numbers and ends with only '-' and one alphabet. Same of the regex that should pass is 1234-M
How d i write this? I wrote this but it allows for multiple alphabets at the end and doesnt add '-'.
"^\d*(?:_?[A-Za-z]{1,1})*$"
Any help is appreciated