Skip to content

Instantly share code, notes, and snippets.

@aaroncrespo
Created December 20, 2012 22:29
Show Gist options
  • Select an option

  • Save aaroncrespo/4349129 to your computer and use it in GitHub Desktop.

Select an option

Save aaroncrespo/4349129 to your computer and use it in GitHub Desktop.
Simple Match IP's
teststring.match(/(?<ip>(\d{1,3}\.){3}\d{1,3})/)[:ip]
# detects strings that look like IPv4 ip's
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment