I have created a RegExp but need to add some other variables
Valid exp should allow an empty string - if not an empty string must be a number only or the following 000000-A-000000-000 as below.
I’m not sure how to add ‘conditionals’ in exp’s
the | operator allows the regular expression to match if any one of a number of conditions is satisfied. E.g. /foo|bar/ will match “foo” or “bar”, but nothing else.
Throw your stones, but I would never use regex for such a scenario. If I have exact three states to check I would always use an if with three conditions.
Regex is great if you need to match patterns but not for fix values