youtuber Posted June 1, 2016 Share Posted June 1, 2016 (edited) source code <a href="/url?q=https://www.autoitscript.com/trial&sa=U <a href="/url?q=https://www.autoitscript.com/trial2/&sa=U how should it be? $var = StringRegExp($sData, '(?i).*<a href="/url?q=.*">(.+?)&\sa=U', 3) Edited June 1, 2016 by youtuber Link to comment Share on other sites More sharing options...
UEZ Posted June 1, 2016 Share Posted June 1, 2016 #include <Array.au3> $sData = '<a href="/url?q=https://www.autoitscript.com/trial2/&sa=U' & @CRLF & '<a href="/url?q=https://www.autoitscript.com/trial2/&sa=U' $var = StringRegExp($sData, '(?i).*=(http.+)\&.*', 3) _ArrayDisplay($var) youtuber 1 Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
youtuber Posted June 1, 2016 Author Share Posted June 1, 2016 (edited) @UEZ Thank you Which of them is more accurate? #include <Array.au3> $sData1 = 'id="mref" name="referrer"><title>Autoit</title>' $var1 = StringRegExp($sData1, '(?i)<title>(.*?)</title>', 3) $sData2 = 'id="mref" name="referrer"><title>Autoit</title>' $var2 = StringRegExp($sData2, '(?i)^<title>(.*?)</title>$', 3) $sData3 = 'id="mref" name="referrer"><title>Autoit</title>' $var3 = StringRegExp($sData3, '<title>(.?)*?(.*)</', 3) $sData4 = 'id="mref" name="referrer"><title>Autoit</title>' $var4 = StringRegExp($sData4, '(?i)(?i)^<title>(.*?)<(.*?)', 3) _ArrayDisplay($var1) _ArrayDisplay($var2) _ArrayDisplay($var3) _ArrayDisplay($var4) Edited June 1, 2016 by youtuber Link to comment Share on other sites More sharing options...
mikell Posted June 1, 2016 Share Posted June 1, 2016 #1 is ok #2 works only if there is nothing before/after $sData2 #3 and #4 are fantasy There is no need to overcomplicate/overload the pattern $sData = '<a href="/url?q=https://www.autoitscript.com/trial2/&sa=U' & @CRLF & '<a href="/url?q=https://www.autoitscript.com/trial2/&sa=U' $var = StringRegExp($sData, 'http[^&]+', 3) _ArrayDisplay($var) youtuber 1 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