Run Code
|
API
|
Code Wall
|
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
simple cache
variables 1
My code
soncita
piramid2
Calculator
testing ruby
numbers
3.4.0 / 3.5.2 / 3.5.1 / 3.6.1 / 3.6.5.#
Division Function without / or * signs