Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- puts "Matched!" unless /d{3}-d{4}/.match("555-1234").nil?puts "Didn't match!" if /d{3}-d{4}/.match("Not phone number").nil?
- match = /([^@]*)@(.*)/.match("[email protected]")name = match[1]domain = match[2]
- /(bb|[^b]{2})/i
- /^1?$|^(11+?)1+$/
- def is_prime(n)
- str = "1" * n
- return str !~ /^1?$|^(11+?)1+$/
- end
- ^(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])[a-zA-Z0-9]{5,10}$
Add Comment
Please, Sign In to add comment