I have two patterns for javascript:
/^[A-z0-9]{10}$/
- string of exactly length of 10 of alphanumeric symbols.
and
/^\d+$/
- any number of at least length of one.
How to make the expression of OR string of 10 or any number?
var pattern = /^([A-z0-9]{10})|(\d+)$/;
doesn't work by some reason. It passes at lest
pattern.test("123kjhkjhkj33f"); // true
which is not number and not of length of 10 for A-z0-9
string.