import re


def iupac2regex(s):
    """change the IUPAC symbols, e.g. 'U' 'R' 'Y', to equivalent regex
    """

    s=re.subn('U','T',s)[0]
    s=re.subn('R','[AG]',s)[0]
    s=re.subn('Y','[CT]',s)[0]
    s=re.subn('S','[GC]',s)[0]
    s=re.subn('W','[AT]',s)[0]
    s=re.subn('K','[GT]',s)[0]
    s=re.subn('M','[AC]',s)[0]
    s=re.subn('B','[CGT]',s)[0]
    s=re.subn('D','[AGT]',s)[0]
    s=re.subn('H','[ACT]',s)[0]
    s=re.subn('V','[ACG]',s)[0]
    s=re.subn('N','[ACGT]',s)[0]
    return s