Underdogger Posted April 5, 2013 Share Posted April 5, 2013 (edited) <META NAME="class" CONTENT="我是人(哈哈)(呵呵)"> <META NAME="class" CONTENT="我是人(你好)"> <META NAME="class" CONTENT="我是人"> Maybe there are three modes in the HTML file.. (Sometimes appears line 1, sometimes appears line2, sometimes appears line3) But how do I use one pattern to get 我是人 PS.(maybe other words, just grab the value from this position) Thanks a lot. Edited April 5, 2013 by Underdogger Link to comment Share on other sites More sharing options...
AZJIO Posted April 5, 2013 Share Posted April 5, 2013 #include <Array.au3> $sText= _ '<META NAME="class" CONTENT="???(??)(??)">' & @CRLF & _ ' <META NAME="class" CONTENT="???(??)">' & @CRLF & _ ' <META NAME="class" CONTENT="???">' $aRes=StringRegExp($sText, '(<META NAME="class" CONTENT="\?\?\?(?:\(\?\?\))*?">)', 3) _ArrayDisplay($aRes, 'Array') My other projects or all Link to comment Share on other sites More sharing options...
sentry07 Posted April 5, 2013 Share Posted April 5, 2013 I think you're missing a character set or something, Azjio. His example text doesn't have ?s in it. I believe it's Mandarin. I'm not proficient enough in RegEx to know unicode capturing. Would Mandarin characters still be picked up by the w quantifier? Link to comment Share on other sites More sharing options...
Underdogger Posted April 5, 2013 Author Share Posted April 5, 2013 (edited) I think you're missing a character set or something, Azjio. His example text doesn't have ?s in it. I believe it's Mandarin. I'm not proficient enough in RegEx to know unicode capturing. Would Mandarin characters still be picked up by the w quantifier? I do not know why this pattern [u4E00-u9fa5] cannot get the Chinese characters in AutoIt...? It would run normally in C#... Edited April 5, 2013 by Underdogger Link to comment Share on other sites More sharing options...
czardas Posted April 5, 2013 Share Posted April 5, 2013 (edited) I do not know why this pattern [u4E00-u9fa5] cannot get the Chinese characters in AutoIt...? It would run normally in C#... Try this instead: Local $sString = ChrW(0x6211) & ChrW(0x662F) & ChrW(0x4EBA) ; Test string If StringRegExp($sString, "[\x{4E00}-\x{9FA5}]") Then MsgBox(0, "Chinese", "Found") Edited April 5, 2013 by czardas operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now