def MakeTokenRegex(meta_left, meta_right):
  key = meta_left, meta_right
  if key not in _token_re_cache:
    # - Need () grouping for re.split
    # - For simplicity, we allow all characters except newlines inside
    #   metacharacters ({} / [])
    _token_re_cache[key] = re.compile(
        r'(' +
        re.escape(meta_left) +
        r'.+?' +
        re.escape(meta_right) +
        r')')
  return _token_re_cache[key]


# Examples:
Return a (compiled) regular expression for tokenization.
dataset/ETHPy150Open cloudbuilders/radioedit/jsontemplate.py/MakeTokenRegex