# R, 75 bytes

    f=function(x)while(tryCatch(!nchar(x)|x|!x,error = function(e)1))grep(x,'')