Ng-pattern for alphanumeric and all special characters
1 answer
You missed to avoid all characters that need to be processed with \
. The following might work:
ng-pattern="/^[A-Za-z0-9_@.#$=!%^)(\]:\*;\?\/\,}{'\|<>\[&\+-]*$/"
Note that this can be simplified:
ng-pattern="/^[A-z\d_@.#$=!%^)(\]:\*;\?\/\,}{'\|<>\[&\+-]*$/"
Check it out on regex101
+2
source to share