String problem

Hi,I have a string. I want to check if the string contains characters like "/ ? \ = #" and tell him that he has entered illegal character. How do I do this. Please suggest a method other than StringTokenizer.thanks,@debug
[249 byte] By [@debuga] at [2007-11-27 7:47:33]
# 1
String.matches("^.*[/\\?\\\\=#].*$") ; maybe?
masijade.a at 2007-7-12 19:28:38 > top of Java-index,Java Essentials,New To Java...
# 2
thanks for the reply but that didn't help though ?
@debuga at 2007-7-12 19:28:38 > top of Java-index,Java Essentials,New To Java...
# 3
> thanks for the reply but that didn't help though ?Yes it does. Can you be a bit more specific? How did you use that code?
prometheuzza at 2007-7-12 19:28:38 > top of Java-index,Java Essentials,New To Java...
# 4
> thanks for the reply but that didn't help though ?It helps as much as is possible given your extremely vague question.
jverda at 2007-7-12 19:28:38 > top of Java-index,Java Essentials,New To Java...
# 5
I think It could be solved by converting the string into string array and comparing each character. This is what I got into my small brain
Suri.ya at 2007-7-12 19:28:38 > top of Java-index,Java Essentials,New To Java...
# 6
Sorry it is Character array not string array ok.
Suri.ya at 2007-7-12 19:28:38 > top of Java-index,Java Essentials,New To Java...
# 7
> I think It could be solved by converting the string> into string array and comparing each character. This> is what I got into my small brainNot really the best solution. A regex solution along the lines given in the first reply is what is required.
sabre150a at 2007-7-12 19:28:38 > top of Java-index,Java Essentials,New To Java...
# 8
I don't know the java regular expressions sintax, but in other languages exists the special character \W that matches a non-word character(same as [^a-zA-Z_0-9]).Can it solve the problem?
Bruno_Grassellia at 2007-7-12 19:28:38 > top of Java-index,Java Essentials,New To Java...
# 9

> I don't know the java regular expressions sintax, but

> in other languages exists the special character

> \W that matches a non-word character(same as

> [^a-zA-Z_0-9]).

> Can it solve the problem?

No because the character class \W consists of much more than the OP's five characters: / ? \ = # (unless those five were just an example of the OP)

prometheuzza at 2007-7-12 19:28:38 > top of Java-index,Java Essentials,New To Java...