def METHOD_NAME(entry, options, value):
    entry_decl = dict(options.get(None, {}))
    if not value.startswith('_'):
        entry_decl['value'] = value
    if isinstance(entry, str):
        if entry.startswith(_regex_prefix):
            entry_decl["regex"] = [entry[len(_regex_prefix):]]
        else:
            entry_decl["string"] = [entry]
    else:
        entry_decl.update(entry)
    if "pattern" in entry_decl:
        legacy_pattern = entry.pop("pattern")
        if legacy_pattern.startswith(_regex_prefix):
            entry_decl["regex"] = [legacy_pattern[len(_regex_prefix):]]
        else:
            entry_decl["string"] = [legacy_pattern]
    return entry_decl