import re
import itertools


def compile_read_regex(read_tags, file_extension):
    """Generate regular expressions to disern direction in paired-end reads."""
    read_regex = [re.compile(r'{}\.{}$'.format(x, y))\
                  for x, y in itertools.product(read_tags, [file_extension])]
    return read_regex