I have a requirement for an input field that should allow numbers, alphabets, and special characters like #
,$
,%
,^
etc. But with only one condition the first character that I enter in the text box should not be a special character.
Example:
I tried this
ng-pattern="/^([a-zA-Z0-9]+)([a-zA-Z0-9 &()_+@&\-=\\|,.\/?\s]+)$/"
But not working.
Try this one
ng-pattern="/^[a-zA-Z0-9]+[^]*$/"
[a-zA-Z0-9]+
means one of alphabet or number and
[^]*
means everything