Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
再会。
我的工作需要我去查询并得到响应。我似乎无法删除此匹配组中的字母或名称。我只需要得到数字 917857
我使用 rubular 来检查匹配是否正确。
917857 詹姆斯邦德
这是获取数字位于字符串开头且仅为数字的数字的正则表达式:
\<listRel:entityId\>(\d+)[\s\w]+<\/listRel:entityId\>
这是一个工作示例: Regex101
对此进行了调整以匹配附加输入示例。