error: the first argument must be string but what I have is regex expression