テックアイエスガイド エディター
無料プログラミング体験会の予約
実行
1
2
3
4
5
6
7
8
9
10
import re
txt = "hello planet"
#文字列が「hello」で始まるかどうかを確認します。
x = re.findall("^hello", txt)
if x:
print("Yes, the string starts with 'hello'")
else:
print("No match")