#format text_markdown 正規表現 ======= 作るのに苦労した正規表現をメモ。 の中から特定の属性だけを抜き出す -------------------------------------------------------------- 後で詳しく書く python ```python ptn = r'])))\s+[^\s=]+=(?:(?:"[^"]*")|(?:[^\s>]*)))*)(?:(\s+class=)(?:(?:"([^"]*)")|([^\s>]*)))?(.*?)>(.*)' ```