<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>potisan</author_name>
  <author_url>https://blog.hatena.ne.jp/potisan/</author_url>
  <blog_title>potisanのプログラミングメモ</blog_title>
  <blog_url>https://potisan-programming-memo.hatenablog.jp/</blog_url>
  <categories>
    <anon>Python 3</anon>
    <anon>まとめ未登録（管理用）</anon>
  </categories>
  <description>反復可能オブジェクト（Iterable）から正規表現の一致部分が重複しない要素を１つずつ抜き出すサンプルコードです。辞書型dictがキーと値のタプルで初期化でき、キーの重複する値を自動で上書きすることを利用しています。 import re #元から重複しないのでセットとして用意 #リスト[...]などでも構わない。 values = (&quot;ab1111&quot;, &quot;ab1112&quot;, &quot;ac2111&quot;, &quot;ac2112&quot;) #正規表現パターンの準備 #末尾2桁を一致部分とする。 #先頭が&quot;a&quot;でない要素は除外する。 pattern = re.compile(r&quot;^a.+(\d\d)$&quot;) #パターンの一…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fpotisan-programming-memo.hatenablog.jp%2Fentry%2F2021%2F07%2F25%2F175438&quot; title=&quot;Python3 反復可能オブジェクトから正規表現の一致部分が重複しない要素を１つずつ抜き出す - potisanのプログラミングメモ&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2021-07-25 17:54:38</published>
  <title>Python3 反復可能オブジェクトから正規表現の一致部分が重複しない要素を１つずつ抜き出す</title>
  <type>rich</type>
  <url>https://potisan-programming-memo.hatenablog.jp/entry/2021/07/25/175438</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
