'Pre-compile regular expressions.'

def _prep_regexes(self):

    self._re_columns = []
    self._pr_options = []
    _final = self.preparer.final_quote
    quotes = dict(zip(('iq', 'fq', 'esc_fq'), [re.escape(s) for s in (self.preparer.initial_quote, _final, self.preparer._escape_identifier(_final))]))
    self._pr_name = _pr_compile(('^CREATE    (?:\\w+    +)?TABLE    +%(iq)s(?P<name>(?:%(esc_fq)s|[^%(fq)s])+)%(fq)s    +\\($' % quotes), self.preparer._unescape_identifier)
    self._re_keyexprs = _re_compile(('(?:(?:%(iq)s((?:%(esc_fq)s|[^%(fq)s])+)%(fq)s)(?:\\((\\d+)\\))?(?=\\,|$))+' % quotes))
    self._re_csv_str = _re_compile('\\x27(?:\\x27\\x27|[^\\x27])*\\x27')
    self._re_csv_int = _re_compile('\\d+')
    self._re_column = _re_compile(('        %(iq)s(?P<name>(?:%(esc_fq)s|[^%(fq)s])+)%(fq)s    +(?P<coltype>\\w+)(?:\\((?P<arg>(?:\\d+|\\d+,\\d+|(?:\\x27(?:\\x27\\x27|[^\\x27])*\\x27,?)+))\\))?(?:    +(?P<unsigned>UNSIGNED))?(?:    +(?P<zerofill>ZEROFILL))?(?:    +CHARACTER    SET    +(?P<charset>[\\w_]+))?(?:    +COLLATE    +(?P<collate>[\\w_]+))?(?:    +(?P<notnull>NOT    NULL))?(?:    +DEFAULT    +(?P<default>(?:NULL|\\x27(?:\\x27\\x27|[^\\x27])*\\x27|\\w+(?:    +ON    UPDATE    \\w+)?)))?(?:    +(?P<autoincr>AUTO_INCREMENT))?(?:    +COMMENT    +(P<comment>(?:\\x27\\x27|[^\\x27])+))?(?:    +COLUMN_FORMAT    +(?P<colfmt>\\w+))?(?:    +STORAGE    +(?P<storage>\\w+))?(?:    +(?P<extra>.*))?,?$' % quotes))
    self._re_column_loose = _re_compile(('        %(iq)s(?P<name>(?:%(esc_fq)s|[^%(fq)s])+)%(fq)s    +(?P<coltype>\\w+)(?:\\((?P<arg>(?:\\d+|\\d+,\\d+|\\x27(?:\\x27\\x27|[^\\x27])+\\x27))\\))?.*?(?P<notnull>NOT    NULL)?' % quotes))
    self._re_key = _re_compile(('        (?:(?P<type>\\S+)    )?KEY(?:    +%(iq)s(?P<name>(?:%(esc_fq)s|[^%(fq)s])+)%(fq)s)?(?:    +USING    +(?P<using_pre>\\S+))?    +\\((?P<columns>.+?)\\)(?:    +USING    +(?P<using_post>\\S+))?(?:    +KEY_BLOCK_SIZE    +(?P<keyblock>\\S+))?(?:    +WITH    PARSER    +(?P<parser>\\S+))?,?$' % quotes))
    kw = quotes.copy()
    kw['on'] = 'RESTRICT|CASCADE|SET    NULL|NOACTION'
    self._re_constraint = _re_compile(('        CONSTRAINT    +%(iq)s(?P<name>(?:%(esc_fq)s|[^%(fq)s])+)%(fq)s    +FOREIGN    KEY    +\\((?P<local>[^\\)]+?)\\)    REFERENCES    +(?P<table>%(iq)s[^%(fq)s]+%(fq)s(?:\\.%(iq)s[^%(fq)s]+%(fq)s)?)    +\\((?P<foreign>[^\\)]+?)\\)(?:    +(?P<match>MATCH    \\w+))?(?:    +ON    DELETE    (?P<ondelete>%(on)s))?(?:    +ON    UPDATE    (?P<onupdate>%(on)s))?' % kw))
    self._re_partition = _re_compile('(?:.*)(?:SUB)?PARTITION(?:.*)')
    for option in _options_of_type_string:
        self._add_option_string(option)
    for option in ('ENGINE', 'TYPE', 'AUTO_INCREMENT', 'AVG_ROW_LENGTH', 'CHARACTER    SET', 'DEFAULT    CHARSET', 'CHECKSUM', 'COLLATE', 'DELAY_KEY_WRITE', 'INSERT_METHOD', 'MAX_ROWS', 'MIN_ROWS', 'PACK_KEYS', 'ROW_FORMAT', 'KEY_BLOCK_SIZE'):
        self._add_option_word(option)
    self._add_option_regex('UNION', '\\([^\\)]+\\)')
    self._add_option_regex('TABLESPACE', '.*?    STORAGE    DISK')
    self._add_option_regex('RAID_TYPE', '\\w+\\s+RAID_CHUNKS\\s*\\=\\s*\\w+RAID_CHUNKSIZE\\s*=\\s*\\w+')
