How do I get the regular expression for excluding special charaters and numbers? Thanks in advance.
Asked
Active
Viewed 1.4k times
4
-
1How do you define "special character". Is `é` a special character? How about `商`? – Fredrik Mörk Apr 14 '11 at 05:29
-
Is space a spacial character? The question would be much more answerable with a few valid/invalid examples. – Kobi Apr 14 '11 at 05:33
-
possible duplicate of [Regular Expression for alphanumeric and underscores](http://stackoverflow.com/questions/336210/regular-expression-for-alphanumeric-and-underscores) – Cody Gray - on strike Apr 14 '11 at 05:34
-
The special charaters are here " ( )[ ]{ }*& ^ % $ # @ !" please privide me the solution – Hemant Kumar Apr 14 '11 at 06:10
2 Answers
4
possible regex
[^()[\]{}*&^%$#@!]+
this will match anything but ()[]{}*&^%$#@!
the [^...]+
is a "any character except ..." and the ]
must be escaped with \]

bw_üezi
- 4,483
- 4
- 23
- 41