andrei, thanks for the pointer to search_append. i got search_insert done. while writing it i noticed that there is no regfree call in whole textops.c. i have the impression that regexp memory allocated by regcomp must be freed by regfree. -- juha