Skip to content

Instantly share code, notes, and snippets.

Created December 23, 2012 09:30
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save anonymous/4362742 to your computer and use it in GitHub Desktop.
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