{
    "Swap the case of text (ignore tags)": "from icu import swap_case\nfrom calibre.ebooks.oeb.polish.utils import apply_func_to_html_text\n\ndef replace(match, number, file_name, metadata, dictionaries, data, functions, *args, **kwargs):\n    '''Swap the case of the matched text, ignoring the text inside tag definitions.'''\n    return apply_func_to_html_text(match, swapcase)\n", 
    "Swap the case of text": "from icu import swap_case\nfrom calibre.ebooks.oeb.polish.utils import apply_func_to_match_groups\n\ndef replace(match, number, file_name, metadata, dictionaries, data, functions, *args, **kwargs):\n    '''Swap the case of the matched text. If the regular expression contains groups,\n    only the text in the groups will be changed, otherwise the entire text is\n    changed.'''\n    return apply_func_to_match_groups(match, swapcase)\n", 
    "Capitalize text": "from calibre.utils.icu import capitalize\nfrom calibre.ebooks.oeb.polish.utils import apply_func_to_match_groups\n\ndef replace(match, number, file_name, metadata, dictionaries, data, functions, *args, **kwargs):\n    '''Capitalize matched text. If the regular expression contains groups,\n    only the text in the groups will be changed, otherwise the entire text is\n    changed.'''\n    return apply_func_to_match_groups(match, capitalize)\n", 
    "Upper-case text (ignore tags)": "from calibre.utils.icu import upper\nfrom calibre.ebooks.oeb.polish.utils import apply_func_to_html_text\n\ndef replace(match, number, file_name, metadata, dictionaries, data, functions, *args, **kwargs):\n    '''Make matched text upper case, ignoring the text inside tag definitions.'''\n    return apply_func_to_html_text(match, upper)\n", 
    "Lower-case text": "from calibre.utils.icu import lower\nfrom calibre.ebooks.oeb.polish.utils import apply_func_to_match_groups\n\ndef replace(match, number, file_name, metadata, dictionaries, data, functions, *args, **kwargs):\n    '''Make matched text lower case. If the regular expression contains groups,\n    only the text in the groups will be changed, otherwise the entire text is\n    changed.'''\n    return apply_func_to_match_groups(match, lower)\n", 
    "Capitalize text (ignore tags)": "from calibre.utils.icu import capitalize\nfrom calibre.ebooks.oeb.polish.utils import apply_func_to_html_text\n\ndef replace(match, number, file_name, metadata, dictionaries, data, functions, *args, **kwargs):\n    '''Capitalize matched text, ignoring the text inside tag definitions.'''\n    return apply_func_to_html_text(match, capitalize)\n", 
    "Lower-case text (ignore tags)": "from calibre.utils.icu import lower\nfrom calibre.ebooks.oeb.polish.utils import apply_func_to_html_text\n\ndef replace(match, number, file_name, metadata, dictionaries, data, functions, *args, **kwargs):\n    '''Make matched text lower case, ignoring the text inside tag definitions.'''\n    return apply_func_to_html_text(match, lower)\n", 
    "Title-case text": "from calibre.utils.titlecase import titlecase\nfrom calibre.ebooks.oeb.polish.utils import apply_func_to_match_groups\n\ndef replace(match, number, file_name, metadata, dictionaries, data, functions, *args, **kwargs):\n    '''Title-case matched text. If the regular expression contains groups,\n    only the text in the groups will be changed, otherwise the entire text is\n    changed.'''\n    return apply_func_to_match_groups(match, titlecase)\n", 
    "Upper-case text": "from calibre.utils.icu import upper\nfrom calibre.ebooks.oeb.polish.utils import apply_func_to_match_groups\n\ndef replace(match, number, file_name, metadata, dictionaries, data, functions, *args, **kwargs):\n    '''Make matched text upper case. If the regular expression contains groups,\n    only the text in the groups will be changed, otherwise the entire text is\n    changed.'''\n    return apply_func_to_match_groups(match, upper)\n", 
    "Title-case text (ignore tags)": "from calibre.utils.titlecase import titlecase\nfrom calibre.ebooks.oeb.polish.utils import apply_func_to_html_text\n\ndef replace(match, number, file_name, metadata, dictionaries, data, functions, *args, **kwargs):\n    '''Title-case matched text, ignoring the text inside tag definitions.'''\n    return apply_func_to_html_text(match, titlecase)\n"
}