Using JavaScript I have to test a value to ensure it is alphanumeric, but it can also have a selection of optional special chars - I currently have:
[A-Za-z0-9\/_\+£&@"\?!'\.,\(\)]
But this fails the optional aspect of the test.
E.g. these should be valid:
alpha1234
alpha1234!
1234alpha
!1234alpha
1234!qwer
But these should fail:
alpha
1234
Hopefully someone can either point me in the right direction or has the answer handy :) or if you need to know more, just let me know.
Thanks in advance.