[過去ログ] Pythonのお勉強 Part68 (1002レス)
前次1-
抽出解除 レス栞

このスレッドは過去ログ倉庫に格納されています。
次スレ検索 歴削→次スレ 栞削→次スレ 過去ログメニュー
866
(1): (ワッチョイ 6347-gR3A) 2022/11/17(木)17:09 ID:HF5V3LeY0(1/5) AAS
import re
str = 'abc123456defg'
s = 'bc'
m = re.search(f'{s}(\d{2})', str)
if m:
 print(m.groups()[0])

\d{2}だと12が表示される
\d{1}とか\d{6}だと想定と違う
なんで?
876
(1): (ワッチョイ c533-BvCT) 2022/11/17(木)21:45 ID:SeoZPm6s0(1) AA×
>>1>>866

外部リンク:techiedelight.com
外部リンク:ideone.com
外部リンク:pastebin.com
外部リンク:dpaste.com
前次1-
スレ情報 赤レス抽出 画像レス抽出 歴の未読スレ

ぬこの手 ぬこTOP 0.045s