Created
December 4, 2014 01:25
-
-
Save anonymous/a1110c17a8487e1213b2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def matchArray(line) | |
match = line.scan(/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/) #[192.168.220.48] | |
match.each do |x| | |
split_array = x.split(".") #192 168 220 48 | |
return string_array = split_array.to_s #["192", "168", "220", "48"] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment