Man arrested for attempting to kill ex-girlfriend, police say