Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
IS_IP?
#!/usr/bin/env ruby # 0-255.0-255.0-255.0-255 def is_ip?(ip) a = ip.split('.') a.size == 4 && !a.any? { |segment| segment.to_s =~ /[A-Za-z]/ } && a.all? {|segment| segment.to_i.between?(0,255) } end puts is_ip?("122.115.233.xxx") puts "123".to_s
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
piramid
variables output
comments
string orperations lecture and print
Adiel Vasquez
variables 1
Hex Color Reader (Ruby)
boolean
numbers
simple cache
Please log in to post a comment.