Manipulating Strings

how can i check if my string only has integers, (, ), +, -, *, /, %I am writing an infix to postifx program and cannot let the program crash no matter what the user inputs. How can i check to make sure the string only contains the items i listed above.
[266 byte] By [hyetecka] at [2007-10-2 5:49:46]
# 1
Use regular expressions, see the API documentation of package java.util.regex.
jesperdja at 2007-7-16 1:59:13 > top of Java-index,Java Essentials,Java Programming...
# 2

this what i have so far. I am not sure how to check if it is an integer though. Is there a method in Java that allows you to check if the character is an integer or not?

boolean goodInfix = true;

for(int i=0; i<exp.length(); i++)

{

if(charAt(i)='+' || charAt(i)='-' || charAt(i)='*' || charAt(i)='/' ||

charAt(i)='%' || charAt(i)=' ' || charAt(i)='(' || charAt(i)=')')

goodInfix = true;

else

goodInfix = false;

}

>

hyetecka at 2007-7-16 1:59:13 > top of Java-index,Java Essentials,Java Programming...
# 3
> Is there a method in Java that allows you to check if the character is an> integer or not?System.out.println(Character.isDigit('1'));System.out.println(Character.isDigit('a'));
prometheuzza at 2007-7-16 1:59:13 > top of Java-index,Java Essentials,Java Programming...
# 4
thanks!
hyetecka at 2007-7-16 1:59:13 > top of Java-index,Java Essentials,Java Programming...