Kyan Posted July 31, 2017 Share Posted July 31, 2017 (edited) Hi, I'm trying to get the language tags (pt_pt, en_gb,...) and their data "ALLWORK" in this case, why isn't it working? $aPreDATA = '<div data-type="inputText" name="title" data-multilang data-legend="Título" data-force><pt_pt>ALLWORK</pt_pt><en_gb>ALLWORK</en_gb><fr_fr>ALLWORK</fr_fr><de_de>ALLWORK</de_de></div>' $atitle = StringRegExp($aPreDATA,'(?i)<div data-type="inputText" name="title".*?>(?:<(\w{2}_\w{2})>(.+?)</\g-1>)+?</div>',3) _ArrayDisplay($atitle) Also tried this and no luck $aPreDATA = '<div data-type="inputText" name="title" data-multilang data-legend="Título" data-force><pt_pt>ALLWORK</pt_pt><en_gb>ALLWORK</en_gb><fr_fr>ALLWORK</fr_fr><de_de>ALLWORK</de_de></div>' $atitle0 = StringRegExp($aPreDATA,'(?i)<div data-type="inputText" name="title".*?>(.+?)</div>',3) $atitle = StringRegExp($atitle0,'(?i)<(\w{2}_\w{2})>(.*?)</',3) Thanks in advance Edited July 31, 2017 by Kyan Heroes, there is no such thing One day I'll discover what IE.au3 has of special for so many users using it.C'mon there's InetRead and WinHTTP, way better Link to comment Share on other sites More sharing options...
AndyG Posted July 31, 2017 Share Posted July 31, 2017 Hi, #include<array.au3> $aPreDATA = '<div data-type="inputText" name="title" data-multilang data-legend="Título" data-force><pt_pt>ALLWORK</pt_pt><en_gb>ALLWORK</en_gb><fr_fr>ALLWORK</fr_fr><de_de>ALLWORK</de_de></div>' $atitle = StringRegExp($aPreDATA,'(?i)(\w{2}_\w{2})>(.+?)<\/\g1>',3) _ArrayDisplay($atitle) Link to comment Share on other sites More sharing options...
mikell Posted July 31, 2017 Share Posted July 31, 2017 Or this.. $atitle = StringRegExp($aPreDATA, '<\w{2}_\w{2}>([^<]+)', 3) Link to comment Share on other sites More sharing options...
iamtheky Posted July 31, 2017 Share Posted July 31, 2017 regexp is lazy #include<array.au3> $sPreDATA = '<div data-type="inputText" name="title" data-multilang data-legend="Título" data-force><pt_pt>ALLWORK</pt_pt><en_gb>ALLWORK</en_gb><fr_fr>ALLWORK</fr_fr><de_de>ALLWORK</de_de></div>' $aSplit = stringsplit(stringtrimleft(stringtrimright($sPreData , 6) , stringinstr($sPreDATA , "data-force>") + stringlen("data-force>") - 1) , "><" , 2) _ArrayDisplay($aSplit) ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
mikell Posted July 31, 2017 Share Posted July 31, 2017 Lazy ? noooo. Just a little misunderstanding - maybe $atitle = StringRegExp($aPreDATA, '(<\w{2}_\w{2}>)([^<]+)', 3) Link to comment Share on other sites More sharing options...
iamtheky Posted July 31, 2017 Share Posted July 31, 2017 that one is even lazier+ ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) 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