2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

ULIDをヒットさせる正規表現

Last updated at Posted at 2022-07-08

概要

  • ULIDをヒットさせるための正規表現をメモ的に記載しておく。

ULIDのフォーマット

  • 下記のようなタイムスタンプ部10桁とランダム部16桁を合体した26桁

  • 0~9の数字とA~Z(I, L, Oを除く)を使用しており大文字小文字を区別しない。

    TTTTTTTTTTXXXXXXXXXXXXXXXX
    

ヒットさせる正規表現

  • I, L, Oを除くの条件をあえて無視して簡単に済ませたい時

    [0-9a-zA-Z]{26}
    
  • I, L, Oを除くの条件を含めしっかり表現したい時

    [0-9a-hjkmnp-zA-HJKMNP-Z]{26}
    
2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?