2024-10-01 13:39:36 发布
网友
所以我需要确定模式“X”或“spaceCAPITAL” 示例:
string="Hello World, This is KZ"
程序会选出:
>>> import re >>> strs = "Hello World, This is KZ" >>> re.findall(r'\s([A-Z])', strs) ['W', 'T', 'K']
试试这个:
import re re.findall(' ([A-Z])', string)
试试这个:
相关问题 更多 >
编程相关推荐