I need to create a regex that returns true if the first three digits are not 666. Here are some examples:
66600abc - false
606asdfnh - true
600asdfasdf -true
I have tried this but I don't get the desired result.
System.out.println(Pattern.matches("[(^[(6)(6)(6)])][a-zA-Z0-9]*", "6660"));
System.out.println(Pattern.matches("[^6]{3}[a-zA-Z0-9]*", "606"));
System.out.println(Pattern.matches("[^666]{3}[a-zA-Z0-9]*", "506"));
System.out.println(Pattern.matches("[^666][a-zA-Z0-9]*", "636"));
System.out.println(Pattern.matches("[^666][a-zA-Z0-9]*", "666"));