Your code didn't work. Firstly I was required to use three numbers in each octet. I want it to accept only 1-3 numbers. I fixed that by changing {2} to {1,3}. Then I could only put two or three numbers in, one number didn't match because you put [0-9] twice. I made it so it was was like [0-9]{1,3}, but that gets me back to the same code I already messed with earlier and I don't get the results I want.