import re


def postprocess_pages(field, pages, **options):
    """Convert a page range to a 2-element tuple."""
    values = re.split(r'\-+', pages)

    if len(values) == 2:
        try:
            return (int(values[0]), int(values[1]))
        except (ValueError, TypeError):
            return pages
    else:
        return pages