LoginSignup
2
4

More than 3 years have passed since last update.

Pythonで正規表現

Last updated at Posted at 2020-10-13

ソースコードは以下になります。

import re

string = "0"
result = re.fullmatch(r'0|1|2', string)

if result:
    print("Match!")
else:
    print("Not Match")

実行結果は以下になります。

Match!

最後まで読んでいただきありがとうございました。
またお会いしましょう。

2
4
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
4