sonic208 Posted April 10, 2017 Share Posted April 10, 2017 (edited) guys im going crazy why the hell is this regex not working ? the string look likes this "blabla":{20},"resultCode":{"$":0}}} and i want to have the value in the brackets, so the 0 $blabla = StringRegExp($sHTML,'([^}]+)',3) $resultcode = StringRegExp($sHTML,'([^}]+)',3) if a just got at least something saved into the variable , but nothing i always get either a 0 or a 1 saved to the variable although there is some other number in the brackets EDIT: now i get values added to the array but not in the way id like too .. Edited April 10, 2017 by sonic208 Link to comment Share on other sites More sharing options...
iamtheky Posted April 10, 2017 Share Posted April 10, 2017 (edited) If they are all in that format then blabla will be in $atest[0] and ResultCode in $atest[1] #include<array.au3> $stest = '"blabla":{20},"resultCode":{"$":0}}}' _ArrayDisplay(stringregexp($stest , "{*(\d+)}" , 3)) Edited April 10, 2017 by iamtheky ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
jguinch Posted April 10, 2017 Share Posted April 10, 2017 This ? $string = '"blabla":{20},"resultCode":{"$":0}}}' $val = StringRegExp($string, ":(\d+)\}", 1) MsgBox(0, "", $val[0] ) Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
mikell Posted April 10, 2017 Share Posted April 10, 2017 Or this $string = '"blabla":{20},"resultCode":{"$":0}}}' $val = StringRegExp($string, ":([^}{]+)", 1) MsgBox(0, "", $val[0] ) 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