list1 = ['Contact: Hamdan Z Hamdan, MBBS, Msc',
'\r\n ',
'+249912468264',
'\r\n ',
'hamdanology@hotmail.com',
'\r\n ',
'Contact: Maha I Mohammed, MBBS, PhD',
'\r\n ',
'+249912230895',
'\r\n ',
'\r\n ',
'Sudan',
'Jaber abo aliz',
'\r\n ',
'Recruiting',
'\r\n ',
'Khartoum, Sudan, 1111 ',
u'Contact: Khaled H Bakheet, MD,PhD \xa0 \xa0 +249912957764 \xa0 \xa0 ',
'khalid2_3456@yahoo.com',
u' \xa0 \xa0 ',
u'Principal Investigator: Hamdan Z Hamdan, MBBS,MSc \xa0 \xa0 \xa0 \xa0 \xa0 \xa0 ',
'Principal Investigator:',
'\r\n ',
'Hamdan Z Hamdan, MBBS, MSc',
'\r\n ',
'Al-Neelain University',
'\r\n '
]
この文字列のリストから、他の文字に関連付けるべきではない 4 桁の整数のみを抽出する必要がありますか?
例: '1111' のみが必要な出力です。
Pythonで正規表現をどのように書くべきですか? 明らかに、これは機能しません: *([\d]{4})*
.