<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>subaru-hello</author_name>
  <author_url>https://blog.hatena.ne.jp/subaru-hello/</author_url>
  <blog_title>subaru-hello’s blog</blog_title>
  <blog_url>https://subaru-hello.hateblo.jp/</blog_url>
  <categories>
    <anon>駆け出しエンジニア</anon>
    <anon>業務振り返り</anon>
    <anon>正規表現</anon>
  </categories>
  <description>サブドメインに使えない文字列を正規表現で制限をかける マルチテナントサービスを運営する時にサブドメインが使われることがあります。 サブドメインに使用できない文字が存在するため、バリデーションをかけるような正規表現が求められます。 admin,www,ftmなどの予約語は使えません。 ドメイン名の正規表現 正規表現の様々な技を駆使してサブドメインに使用することを許されていない文字にバリデーションをかけました。 具体的に下記のような制約を持った文字列にバリデーションをかけることを想定します。 [ ] 「&quot;-&quot;が連続で使われていない」 [ ] 「先頭で&quot;-&quot;.””_”大文字が使われていない」 [ ]…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fsubaru-hello.hateblo.jp%2Fentry%2F2022%2F06%2F03%2F094828&quot; title=&quot;サブドメインに正規表現を使う - subaru-hello’s blog&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>https://cdn.blog.st-hatena.com/images/theme/og-image-1500.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2022-06-03 09:48:28</published>
  <title>サブドメインに正規表現を使う</title>
  <type>rich</type>
  <url>https://subaru-hello.hateblo.jp/entry/2022/06/03/094828</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
