Getting the Twitter account from various input formats
You can use a ruby case statement to check for different regex matches.  If a match is found, it is by definition not nil, so it removes the need for a nil check as well.

twitters.each do |twitter|
  case twitter
    # for the url
    when /twitter.com\/([^\/.]*)$/
      puts $1

    # for @ beginning
    when /^@([^\/.]*)$/
      puts $1

    # if we arrive, we haven't found any coincidence
    else
      puts twitter
  end
end


When ruby does a regex match, any capture groups are assigned to the global variables $1, $2, $3, and so on.  See this question on StackOverflow for more details about the mechanic.

Note on your regex: If you want the capture groups to actually contain anything, you should change the asterisk to a plus: ([^\/.]+).  Without the plus, "www.twitter.com/" will be captured by one of the regex.  With the plus, that string will fall into the default case.