You're viewing a comment by Peteris Krumins and its responses.

November 10, 2011, 12:03

I was confident it was right. I never checked it, I only trusted my reasoning. Now it will be interesting to find where I went wrong.

Edit: Aha, 106 - 109, 116 - 119, ..., 156 - 199 don't get matched, and 206-209, 216-219, 226-229, 236-239, 246-249.

Here is the fix:

/^(([0-9])|([0-9][0-9])|(1[0-9][0-9])|(2[0-4][0-9])|(25[0-5]))$/

Matches 0-9 or 10-99 or 100-199 or 200-249 or 250-255.

Here is the original, broken one that I had:

/^(([0-9])|([0-9][0-9])|([12][0-5][0-5]))$/

Reply To This Comment

(why do I need your e-mail?)

(Your twitter name, if you have one. (I'm @pkrumins, btw.))

Type the first letter of your name: (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.