找回密码
 加入
搜索
查看: 3139|回复: 4

[系统综合] 帮我写一个正则,不只有数字,还有E或e

  [复制链接]
发表于 2014-8-7 12:48:42 | 显示全部楼层 |阅读模式
本帖最后由 sex123 于 2014-8-7 12:51 编辑

http://meta.wkhealth.com/pt/pt-core/template-journal/lwwgateway/media/landingpage.htm?issn=0362-2436&volume=39&issue=1&spage=E20

http://meta.wkhealth.com/pt/pt-core/template-journal/lwwgateway/media/landingpage.htm?issn=1049-2275&volume=24&issue=3&spage=1053

http://meta.wkhealth.com/pt/pt-core/template-journal/lwwgateway/media/landingpage.htm?issn=0148-396X&volume=69&issue=5&spage=E1152

提取出0362-2436  39  1     E20 就是等号和连接号&之间的数字,我现在发现,有的中间有E或e出现。有的还有x出现0148-396X 有没有这么写的,=开头 &或者回车符结尾,取这两者之间的字符?
发表于 2014-8-7 14:07:01 | 显示全部楼层
(?<=\=).+?(?=&|\v)

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2014-8-7 18:35:55 | 显示全部楼层
虽然繁琐,但是应该比2楼的方式可靠,如果是读取网页内容的话.
#include<array.au3>
Local $Str = _
                "http://meta.wkhealth.com/pt/pt-core/template-journal/lwwgateway/media/landingpage.htm?" & _
                                "issn=0362-2436&volume=39&issue=1&spage=E20" & @CRLF & _
                "http://meta.wkhealth.com/pt/pt-core/template-journal/lwwgateway/media/landingpage.htm?" & _
                                "issn=1049-2275&volume=24&issue=3&spage=1053" & @CRLF & _ 
                                "http://meta.wkhealth.com/pt/pt-core/template-journal/lwwgateway/media/landingpage.htm?" & _
                                "issn=0148-396X&volume=69&issue=5&spage=E1152" 
Local $sRE = StringRegExp($Str, '(?i)(?:issn=|volume=|issue=|spage=)([\deXx-]+)', 3)
If Not @error Then _ArrayDisplay($sRE)
发表于 2014-8-7 19:01:37 | 显示全部楼层
本帖最后由 haijie1223 于 2014-8-7 19:06 编辑
=(.*?)[&\s]
=(\w?[\d+-]+)

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2014-8-11 09:39:29 | 显示全部楼层
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-9 07:02 , Processed in 0.080909 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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