I am trying to implement a function in Javascript that verify a string. The pattern i must to do is contain only digits charactor, *, # and +. For example:
+182031203
+12312312312*#
+2131*1231#
*12312+#
#123*########
I tried alot of thing like
/^[\d]{1,}[*,#,+]{1,}$
but it's doesn't work. I am not sure that i understand good in regex. Please help.
[^\d*#+]and negate the results; that is, the string contains only the permissible characters if and only if this match fails (assuming the string is not empty).