I am aware that regEx are common across languages...But I am having trouble in writing the Java syntax. I have a regular expression coded in JS as;
if((/[a-zA-Z]/).test(str) && (/[0-9]|[x21-x2F|x3A-x40|x5B-x60|x7B-x7E]/).test(str))
return true;
How do I write the same in Java ?
I have imported
import java.util.regex.Matcher;
import java.util.regex.Pattern;
Just to add, from what I am trying it is saying x is an invalid escape character..
See Question&Answers more detail:os