开启辅助访问 切换到宽版

精易论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

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

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


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

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

查看: 95|回复: 2
收起左侧

[易语言] 接上一个正则匹配获取指定信息

[复制链接]
结帖率:65% (15/23)
发表于 4 天前 | 显示全部楼层 |阅读模式   浙江省金华市
50精币
<span class="info fl" style="font-size:80px;line-height:80px;background-color: ">332N                    
                </span>
                <span class="info tc" style="line-height: 80px;font-size: 60px;">海宁佳运公司包</span>
                <img src="../../images/logo.jpg" style="" alt="" class="fr info-img" />
            </div>
            <table style="border-collapse: collapse;width: 100%;margin-top: 5px; border: 2px solid #000;">
                <tbody>
                    <tr>
                        <th class="th_td" style="width: 80px;font-size: 18px;"><span class="th_span">目的省</span></th>
                        <th class="th_td" style="width: 200px;font-size: 18px;"><span class="th_span">目的市</span></th>
                        <th class="th_td" style="width: 79%;font-size: 18px;"><span class="th_span">集包区域</span></th>
                    </tr>
                                                                                                                                                                                                                                                                                                                                                                        <tr>
                         <td style="font-size: 18px" class="td-prov" rowspan="1">浙江省</td>                        <td style="font-size: 16px;">嘉兴市</td>
                        <td style="font-size: 14px;font-weight: normal;">海宁市(<span style="font-weight:bold;">海昌街道</span>  <span style="font-weight:bold;">马桥街道</span>  <span style="font-weight:bold;">硖石街道</span>  <span style="font-weight:bold;">海洲街道</span>)</td>
                    </tr>
                                                                                                                                                                                    <tr>
                         <td style="font-size: 18px" class="td-prov" rowspan="1">台湾省</td>                        <td style="font-size: 16px;">新北市</td>
                        <td style="font-size: 14px;font-weight: normal;">平溪区(<span style="font-weight:bold;">311街道</span>)</td>
                    </tr>
                                                                                                    <tr>
                        <td class="td-prov"><span class="th_span">目的国家</span></td>
                        <td></td>
                        <td>&nbsp;</td>
                    </tr>
                </tbody>
            </table>
            <div class="list-item">
                <span class="fr" style="padding-right: 10px">浙江义乌前成公司前成集包仓服务部2025年09月08日集包方案</span>
            </div>
        </div>
        <div style="margin-top: 5px;">&nbsp;</div>
        <div style="page-break-after:always;"></div>        <div class="list-package" style="border:1px solid #bcbcbc;padding: 15px;margin-right: 350px;">
            <div class="top">
                <span class="info fl" style="font-size:80px;line-height:80px;background-color: ">332P                    
                </span>
                <span class="info tc" style="line-height: 80px;font-size: 60px;">海宁佳楠公司包</span>
                <img src="../../images/logo.jpg" style="" alt="" class="fr info-img" />
            </div>
            <table style="border-collapse: collapse;width: 100%;margin-top: 5px; border: 2px solid #000;">
                <tbody>
                    <tr>
                        <th class="th_td" style="width: 80px;font-size: 18px;"><span class="th_span">目的省</span></th>
                        <th class="th_td" style="width: 200px;font-size: 18px;"><span class="th_span">目的市</span></th>
                        <th class="th_td" style="width: 79%;font-size: 18px;"><span class="th_span">集包区域</span></th>
                    </tr>
                                                                                                                                                                                                                                                                                                                                                                        <tr>
                         <td style="font-size: 18px" class="td-prov" rowspan="1">台湾省</td>                        <td style="font-size: 16px;">新北市</td>
                        <td style="font-size: 14px;font-weight: normal;">平溪区(<span style="font-weight:bold;">312街道</span>)</td>
                    </tr>
                                                                                                    <tr>
                        <td class="td-prov"><span class="th_span">目的国家</span></td>
                        <td></td>
                        <td>&nbsp;</td>
                    </tr>
                </tbody>
            </table>
            <div class="list-item">
                <span class="fr" style="padding-right: 10px">浙江义乌前成公司前成集包仓服务部2025年09月08日集包方案</span>
            </div>
        </div>
        <div style="margin-top: 5px;">&nbsp;</div>
        <div style="page-break-after:always;"></div>        <div class="list-package" style="border:1px solid #bcbcbc;padding: 15px;margin-right: 350px;">
            <div class="top">
<span class="info fl" style="font-size:80px;line-height:80px;background-color: ">620A                    
                </span>
                <span class="info tc" style="line-height: 80px;font-size: 60px;">佛山分拨包</span>
                <img src="../../images/logo.jpg" style="" alt="" class="fr info-img" />
            </div>
            <table style="border-collapse: collapse;width: 100%;margin-top: 5px; border: 2px solid #000;">
                <tbody>
                    <tr>
                        <th class="th_td" style="width: 80px;font-size: 18px;"><span class="th_span">目的省</span></th>
                        <th class="th_td" style="width: 200px;font-size: 18px;"><span class="th_span">目的市</span></th>
                        <th class="th_td" style="width: 79%;font-size: 18px;"><span class="th_span">集包区域</span></th>
                    </tr>
                                                                                                                                                                                                                                                                                                                                                                        <tr>
                         <td style="font-size: 18px" class="td-prov" rowspan="2">广东省</td>                        <td style="font-size: 16px;">广州市</td>
                        <td style="font-size: 14px;font-weight: normal;">黄埔区(<span style="font-weight:bold;">长洲街道</span>)  番禺区  南沙区</td>
                    </tr>
                                                            <tr>
                                                <td style="font-size: 16px;">佛山市</td>
                        <td style="font-size: 14px;font-weight: normal;">禅城区  南海区  顺德区  三水区(<span style="font-weight:bold;">白坭镇</span>)</td>
                    </tr>
                                                                                                    <tr>
                        <td class="td-prov"><span class="th_span">目的国家</span></td>
                        <td></td>
                        <td>&nbsp;</td>
                    </tr>
                </tbody>
            </table>
            <div class="list-item">
                <span class="fr" style="padding-right: 10px">浙江义乌前成公司前成集包仓服务部2025年09月08日集包方案</span>
            </div>
        </div>
        <div style="margin-top: 5px;">&nbsp;</div>
        <div style="page-break-after:always;"></div>        <div class="list-package" style="border:1px solid #bcbcbc;padding: 15px;margin-right: 350px;">
            <div class="top">



补充内容 (2025-9-8 17:27):
根据目的省,取出图片里,第一行粗体信息,如果台湾省不在上面,或者没有台湾省,就输出第一行粗体。反之就跳过

补充内容 (2025-9-8 18:21):
https://bbs.ijingyi.com/forum.ph ... 14863769&extra=   源文件

1.png
2.png
3.png

回答提醒:如果本帖被关闭无法回复,您有更好的答案帮助楼主解决,请发表至 源码区 可获得加分喔。
友情提醒:本版被采纳的主题可在 申请荣誉值 页面申请荣誉值,获得 1点 荣誉值,荣誉值可兑换荣誉会员、终身vip用户组。
快捷通道:申请荣誉值

结帖率:100% (1/1)
发表于 3 天前 | 显示全部楼层   浙江省温州市
  
窗口程序集名保 留  保 留备 注
窗口程序集_启动窗口   
子程序名返回值类型公开备 注
__启动窗口_创建完毕  
变量名类 型静态数组备 注
文本文本型 
正则正则表达式 
搜索结果搜索结果0
整数型 
成员文本型3
文本 = #常量1
正则.创建 (“class=.info fl[^>]+.(.+?)\s*./s.+?class=.info tc[^>]+.(.+?)./s.+?rowspan=.+?>(.+?)./td>”, )
搜索结果 = 正则.搜索全部 (文本)
计次循环首 (取数组成员数 (搜索结果), 数)
成员 [1] = 搜索结果 [].取子匹配文本 (文本, 1, )
成员 [2] = 搜索结果 [].取子匹配文本 (文本, 2, )
成员 [3] = 搜索结果 [].取子匹配文本 (文本, 3, )
如果真 (成员 [3]“台湾省”)
调试输出 (成员)

计次循环尾 ()


i支持库列表   支持库注释   
RegEx正则表达式支持库
spec特殊功能支持库

开始运行被调试程序
* 数组:3{“332N”,“海宁佳运公司包”,“浙江省”}
* 数组:3{“620A”,“佛山分拨包”,“广东省”}
被调试易程序运行完毕

评分

参与人数 1好评 +1 收起 理由
超级大乐透 + 1 YYDS~!

查看全部评分

回复

使用道具 举报

结帖率:100% (1/1)
发表于 3 天前 | 显示全部楼层   浙江省温州市
例子.zip (2.23 KB, 下载次数: 0)
回复

使用道具 举报

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

本版积分规则 致发广告者

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

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

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