Python regex检查字符串是否包含方法

2024-10-01 19:29:41 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在用python解析一个xml文件。我获取xml节点的属性值进行处理

<set name="flashScope.emailSuggestion" value="userBean.createEmailSuggestion(flowRequestContext)" />

使用ElementTree,我得到节点的属性

node.attrib['value']

这让我

userBean.createEmailSuggestion(flowRequestContext)

现在如何检查这个字符串是否包含()(我的意思是,要知道这是一个方法调用)…有人能为此建议一个regex模式吗


Tags: 文件namenode属性节点valuexmlset

热门问题