My code is :
if (tokens.matches("true || false")){
checkAssignments (i+1);
return;
}
else{
\\do something else
}
In this code fragment, the value of token is set to 'true' by default. But the control always goes to the else part implying that the regular expression evaluates to false.
Moreover, If i want to check for the presence of the character '+' in my string, what would my regular expression be in Java. I tried :
token.matches(\\+);
and
token.matches(\\Q+\\E);
but none of these work. Any help would be really appreaciated.