I have a string that will accept the following:
this is the pattern: xxx-A-mmddyyyy-xxxxxx
.
The person enters a value either by copying and pasting or hand jams. What I want to do, onBlur()
, is make a function that will remove the first dash in either case.
I want the pattern match to be REGEX that only permits the above. The result would be:
xxxA-mmddyyyy-xxxxxx
That's pretty much it.
This is the REGEX patterns for with DASH and how I want it to look 'after' stripping out the first dash:
public static readonly NUMBERWITHDASH = /^[0-9]{3}-[A-Z]-[0-9]{8}-[0-9]{6}$/;
public static readonly NUMBERNODASH = /^[0-9]{3}[A-Z]-[0-9]{8}-[0-9]{6}$/;