import re


def replace_sphinx_directives(lines):
    """Replace Sphinx directives with reST inline literals."""
    directive_pattern = re.compile(r":(class|func|attr|mod):`([A-z_]*)`")
    edited_lines = [directive_pattern.sub(r"``\2``", line) for line in lines]
    return edited_lines