帮我写一个正则,不只有数字,还有E或e
本帖最后由 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-2436391 E20 就是等号和连接号&之间的数字,我现在发现,有的中间有E或e出现。有的还有x出现0148-396X 有没有这么写的,=开头 &或者回车符结尾,取这两者之间的字符? (?<=\=).+?(?=&|\v) 虽然繁琐,但是应该比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) 本帖最后由 haijie1223 于 2014-8-7 19:06 编辑
=(.*?)[&\s]=(\w?[\d+-]+) {:face (427):}
页:
[1]