Regular expression for English characters

shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Can anybody help me in developing the regular expression for PHP that will help me to detect if the string has any English characters. What I mean by English characters is A-Z, a-z, 0-9 and all the other symbols on keyboard + some extra ones that are used frequently. I am not very good at regular expression.
0
pradeep's Avatar, Join Date: Apr 2005
Team Leader
Yes, sure!

Code: PHP
if(preg_match('/[a-z0-9_-]+/',$stringWhereToCheck))
  print "Has english chars";
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
What about the
Code:
!@#$%^&*()_+<>,.?/"':;{[]}\|
as far as I can remember.
0
pradeep's Avatar, Join Date: Apr 2005
Team Leader
Any english word must have a-z to be a valid word, special characters may or may not be there!
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
But my concern is it can have the string as : ) only also.
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Can you tell me what are the special characters in
Code:
!@#$%^&*()_+<>,.?/"':;{[]}\|
so that I can add the backslash. As far as I can get
Code:
$ , . { [ ] } \
Am I missing something?