gpt4 book ai didi

javascript - 正则表达式

转载 作者:行者123 更新时间:2023-11-29 18:31:26 25 4
gpt4 key购买 nike

我伙计们我需要一些正则表达式方面的帮助:

这是字符串:

<div style="width:477px;" id="__ss_8468630"><strong style="display:block;margin:12px 0 4px;"><a rel="nofollow" target="_blank" href="http://www.slideshare.net/Account/title" title="&#x002019;s DDM SaaS Antivirus Patch Management Solution">DDM SaaS Antivirus Patch Management Solution</a></strong> <div style="padding:5px 0 12px;"> View more documents from <a rel="nofollow" target="_blank" href="http://www.slideshare.net/account">Account</a> </div> </div>

我只需要获取身份证号码。

例如。输出:

8468630

谢谢大家

最佳答案

不需要正则表达式,你可以做一个简单的字符串替换。

element.id.replace('__ss_',''); // => '8468630'

关于javascript - 正则表达式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7756831/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com