modernize. added: autocomplete.when(regexp|function)