Create a gist now

Instantly share code, notes, and snippets.

anonymous /gist:4362742
Created Dec 23, 2012

Validating ranges in regexp
$_ = "Go 127.666.0.1, I said! He went to 173.194.32.32.";
say .Str for m:g/ ( (\d ** 1..3) <?{ 0 < $0 < 255 }> ) ** 4 % "." /;
# should print only 173.194.32.32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment