def _parse_pages_similar_with(token):
    tag_name, arg = _extract_tag_content(token)

    m = re.search(r"""
        (.*?)                                   # slug or varname

        (\s+ limit \s+ (\d+))*                  # optional limit clause

        \s+ as \s+ (\w+) \s*                    # collector variable
    """, arg, flags=re.VERBOSE)
    if not m:
        raise template.TemplateSyntaxError(
            "%r tag had invalid arguments" % tag_name
        )
    page_slug, _, limit, var_name = m.groups()

    return parse_slug(page_slug), limit and int(limit), var_name
dataset/ETHPy150Open pbs/django-cms-pagetags/pagetags/templatetags/page_tags.py/_parse_pages_similar_with/original