嗨,我想得到结果中“citedby”后面的数字。每次搜索数字都会改变
import scholarly
import re
m = next(scholarly.search_pubs_query('Perception of physical stability and center of mass of 3D objects'))
n = re.search('citedby (\d+)', m , re.IGNORECASE)`
我用scholarly查找引文并存储在m变量中。现在我想获取“citedby”后面的数字:34567。示例现在我想获取“citedby”后面的34567:。请帮助我,我是python新手。添加了示例结果。Result ,error
您可以尝试使用^{} 作为字符串列表,它返回字符串中模式的所有非重叠匹配项
关于你的具体问题:
注意:这里
m
是<class 'scholarly.Publication'>
对象str(m)
使它<class 'str'>
findall
仅适用于字符串相关问题 更多 >
编程相关推荐