开启辅助访问 切换到宽版

精易论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

用微信号发送消息登录论坛

新人指南 邀请好友注册 - 我关注人的新帖 教你赚取精币 - 每日签到


求职/招聘- 论坛接单- 开发者大厅

论坛版规 总版规 - 建议/投诉 - 应聘版主 - 精华帖总集 积分说明 - 禁言标准 - 有奖举报

查看: 201|回复: 9
收起左侧

[完成] 怎么取如下文本中的796215 这个数字

 关闭 [复制链接]
结帖率:89% (17/19)
发表于 2024-5-8 20:56:38 | 显示全部楼层 |阅读模式   广东省中山市
5精币
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><!-- bccto_mail --><ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-0837701653391304" data-ad-slot="7051968331" data-ad-format="auto"></ins><script>(adsbygoogle = window.adsbygoogle || []).push({});</script><br/><hr/><br/><html>
<body align="center" style="width:600px;">
        <div> <img src="https://files.catbox.moe/dzq32f.png" </div>
        <div style="text-align:center;font-size:14px;font-weight: blod;margin-top:10px;margin-left:20px;margin-right:20px;padding:5px;background-color: #7367f9;color:white;"> Welcome to register on notes social platform! </div>
<div style="padding-top:20px;font-size:12px;text-align: center;">your verification code</div>
<div style="padding:10px;font-size:25px;color:#422f7f;font-weight:bold;text-align: center;">796215</div>
<div align="left" style="font-size:12px;padding:5px;margin-left:20px;">
<div style="margin:0 10px 10px 10px;" >The verification code is valid for 30 minutes. Never disclose secrets to others. If it is not done by you, please reset your password immediately and contact official customer service.!</div>
<div style="margin:0 10px 10px 10px;">This is an automated verification message, please do not reply.</div>
<div style="margin:0 10px 10px 10px;">Notice:Please make sure you visit the notes official website:<a >www.notes.bet,Beware of fake or phishing websites.        </a></div>

<div  style="margin:0 10px 10px 10px; padding-top:20px; line-height:10px;"><img src="https://files.catbox.moe/aaijz2.png" style="width:10px;height:10px;"><a style="margin-left:10px;line-height: normal;" href="mailto:notesnos666@gmail.com" style="color:rgb(10, 10, 10);text-decoration:none;">notesnos666@gmail.com</a></div>
<div  style="margin:0 10px 10px 10px; padding-top:1px; line-height:10px;"><img src="https://files.catbox.moe/hfdj7t.png" style="width:10px;height:10px;"><a style="margin-left:10px;line-height: normal;"  style="color:blue;text-decoration:none;">Notes_Socia</a></div>
<div  style="margin:0 10px 10px 10px; padding-top:1px; line-height:10px;"><img src="https://files.catbox.moe/6gmoif.png" style="width:10px;height:10px;"><a style="margin-left:10px;line-height: normal;"  style="color:blue;text-decoration:none;">Notes_global_community</a></div>
<div  style="margin:0 10px 10px 10px;padding-top:30px;font-size:16px;font-weight: bold;">Notes team</div>
</div>
</body>
</html><br/><br/><hr/><br/><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><!-- bccto_mail --><ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-0837701653391304" data-ad-slot="7051968331" data-ad-format="auto"></ins><script>(adsbygoogle = window.adsbygoogle || []).push({});</script><br/><script src="https://s95.cnzz.com/z_stat.php?id=3645431&web_id=3645431" language="JavaScript"></script>
麻烦哪个大佬看看怎么取下面文本的 “796215” 这个数字呢?

最佳答案

查看完整内容

>(\d{6})< 表达式 不会写可以用精易助手直接生成代码

结帖率:98% (54/55)

签到天数: 21 天

发表于 2024-5-8 20:56:39 | 显示全部楼层   福建省宁德市
LIUNIAN1 发表于 2024-5-8 21:15
正则怎么写呢 我看应该会变的 取中间取不出来

>(\d{6})<  
表达式
不会写可以用精易助手直接生成代码

评分

参与人数 1荣誉 +1 收起 理由
笨潴 + 1 热心帮助他人,荣誉+1,希望继续努力(*^__^*) 嘻嘻!

查看全部评分

回复

使用道具 举报

结帖率:89% (17/19)

签到天数: 1 天

 楼主| 发表于 2024-5-8 20:57:08 | 显示全部楼层   广东省中山市
顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶
回复

使用道具 举报

结帖率:89% (17/19)

签到天数: 1 天

 楼主| 发表于 2024-5-8 20:57:53 | 显示全部楼层   广东省中山市
秒结帖 秒结帖秒结帖秒结帖秒结帖秒结帖
回复

使用道具 举报

结帖率:32% (6/19)

签到天数: 6 天

发表于 2024-5-8 21:03:59 | 显示全部楼层   广东省深圳市
你直接分割啊
回复

使用道具 举报

结帖率:84% (43/51)

签到天数: 20 天

发表于 2024-5-8 21:04:31 | 显示全部楼层   广东省广州市
<div style="padding:10px;font-size:25px;color:#422f7f;font-weight:bold;text-align: center;">796215</div>

如果前后文本都是固定的话 取文本中间就行
回复

使用道具 举报

结帖率:84% (43/51)

签到天数: 20 天

发表于 2024-5-8 21:05:41 | 显示全部楼层   广东省广州市
回复

使用道具 举报

结帖率:84% (43/51)

签到天数: 20 天

发表于 2024-5-8 21:06:53 | 显示全部楼层   广东省广州市
如果标签会变就写正则了
回复

使用道具 举报

结帖率:89% (17/19)

签到天数: 1 天

 楼主| 发表于 2024-5-8 21:15:11 | 显示全部楼层   广东省中山市
用户名205252 发表于 2024-5-8 21:06
如果标签会变就写正则了

正则怎么写呢 我看应该会变的 取中间取不出来
回复

使用道具 举报

结帖率:92% (192/208)

签到天数: 21 天

发表于 2024-5-8 21:29:44 | 显示全部楼层   广西壮族自治区崇左市
如果内容里,有且只有一个6位的数字,用正则表达式\b\d{6}\b来匹配。

  
子程序名返回值类型公开备 注
正则_匹配批量整数型 本子程序采用【精易编程助手】生成。成功返回匹配的数量,失败返回0。
参数名类 型参考可空数组备 注
源文本文本型欲被匹配的文本
变量名类 型静态数组备 注
局_正则正则表达式类此类为精易模块里面的正则类,精易模块下载地址:http://ec.125.la/
局_匹配数整数型 
局_计次整数型 
局_子匹配数整数型 
如果真 (局_正则.创建 (“\b\d{6}\b”, 源文本, 假, 假, 真,真))
信息框 (“正则创建失败,请检查正则表达式语句是否有误!”, #错误图标, )
返回 (0)
局_匹配数 = 局_正则.取匹配数量 ()
如果真 (局_匹配数 = 0)
信息框 (“匹配失败,请检检查正则语句是否有误,数量:0”, #错误图标, )
返回 (0)
局_子匹配数 = 局_正则.取子匹配数量 ()
计次循环首 (局_匹配数, 局_计次)
如果 (局_子匹配数 > 0)
输出调试文本 (“匹配文本 ”到文本 (局_计次)“ 中的子匹配文本 1:” + 局_正则.取子匹配文本 (局_计次, 1, ))
输出调试文本 (“匹配文本 ”到文本 (局_计次)“ :” + 局_正则.取匹配文本 (局_计次, ))

计次循环尾 ()
返回 (局_匹配数)
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则 致发广告者

发布主题 收藏帖子 返回列表

sitemap| 易语言源码| 易语言教程| 易语言论坛| 诚聘英才| 易语言模块| 手机版| 广告投放| 精易论坛
拒绝任何人以任何形式在本论坛发表与中华人民共和国法律相抵触的言论,本站内容均为会员发表,并不代表精易立场!
论坛帖子内容仅用于技术交流学习和研究的目的,严禁用于非法目的,否则造成一切后果自负!如帖子内容侵害到你的权益,请联系我们!
防范网络诈骗,远离网络犯罪 违法和不良信息举报电话0663-3422125,QQ: 800073686,邮箱:800073686@b.qq.com
Powered by Discuz! X3.4 揭阳市揭东区精易科技有限公司 ( 粤ICP备12094385号-1) 粤公网安备 44522102000125 增值电信业务经营许可证 粤B2-20192173

快速回复 返回顶部 返回列表