regular expression with chinese characters

i want to come up with regular expression that excludes these characters:

`~!@#$%^&*()_+-=\][|}{‘;”:/.,?><

but whatever i come up with also excludes foreign language characters such as chinese or russian:

¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿

can someone tell me if regular expression is the best way to handle this type of situations?  thanks.
mmingfeilamAsked:
Who is Participating?
 
CEHJConnect With a Mentor Commented:
boolean valid = s.matches(.*"[~!@#$%^&*()_+-=\\]\\[|}{‘;”:/.,?><].*)";

Open in new window

would do it if that IS the case
0
 
CEHJCommented:
Chinese characters not a problem - see example below

Russian won't be a problem either
chin.png
0
 
mmingfeilamAuthor Commented:
Can you do an example using reg ex?  Not sure if string replacement is the same as regular expression.
0
 
CEHJCommented:
Yes, it is the same essentially. Is what you're after to test if the string includes any characters that should be excluded and to declare it invalid otherwise?
0
 
CEHJCommented:
:)
0
All Courses

From novice to tech pro — start learning today.