titles = ["Starship Troopers",
          "A Star is Born",
          "Star Wars",
          "Star 69",
          "The Starr Report"]

sorted = titles.sort do |x,y|
  # Delete leading articles
  a = x.sub(/^(a |an |the )/i, "")
  b = y.sub(/^(a |an |the )/i, "")
  # Delete spaces and punctuation
  a.delete!(" .,-?!")
  b.delete!(" .,-?!")
  # Convert to uppercase
  a.upcase!
  b.upcase!
  # Compare a and b
  a <=> b
end

# sorted is now:
# [ "Star 69", "A Star is Born", "The Starr Report"
#   "Starship Troopers", "Star Wars"]

