expand and hook up doc test for _format_to_regex