I have written a Java Program for the regular expression.
I am looking for regular expression which actually returns me false if any of the Characters other than these “N”,”E”,”W”,”S” found in the text.
I have used this Pattern.matches(“[^NWES]”, str) in my program it didn’t worked.
I have written a Java Program for the regular expression. I am looking for
Share
You need to use a quantifier with your Regex: –