I think it is ok for it to be a compiled regexp or the atom `undefined`. That is quite idiomatic for erlang.