import re


def format_example(example):
    """Adds basic formatting to a command example."""
    span = r"""<span class="{}">\1</span>"""
    replacements = [
        ("(TARS)", "inline-bot-name"),
        (r"(?:(?<=: )|(?<=\.)|(?<=\..))([a-z]+)(?= |$)", "inline-command"),
        (r"(?<= |\[)(--[a-z-]{2,}|-[a-z])(?= |\]|$)", "inline-argument"),
        (r"(\[|\]|\.\.\.|,|{|})", "inline-syntax"),
    ]
    for find, name in replacements:
        example = re.sub(find, span.format(name), example)
    return example