might be nice to extract this regex as a closed over "constant"