I am trying to do the following and I tried to find examples of how to do a proper exclusion but I couldn't quite get the hang of it.
I am supposed to exclude the numbers 000, 666, and all numbers between 900-999.
This was my attempt at the question but it doesn't include the exclusion:
String p = "(^[0-9]{3})-([0-9]{2})-([0-9]{4}$)";
Which resulted in unnecessary matches:
This is my attempt at trying the exclusion but I'm unsure how:
String p = "(^[^666000]{3})-([0-9]{2})-([0-9]{4}$)";
Which resulted in some matches:
Any help would be appreciated!