Jump to content

Getting data from source code with regex?


Recommended Posts

#include <Array.au3>
$sText = '{"us":473,"global":367},"rating":false}}])'
$a = StringRegExp($sText, ":(\d+)", 3)

_ArrayDisplay($a)

 

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

thanks

Is there a way without the two for loop to take the figures of this pattern separately

$aAlexaglobalSource1 = StringRegExp($aAlexaSourceRead, '".*"global":(\d+)', 3)
$aAlexaCountryrankingSource2 = StringRegExp($aAlexaSourceRead, '":(\d+).*"global":', 3)
For $j = 0 To UBound($aAlexaglobalSource1) - 1
For $i = 0 To UBound($aAlexaCountryrankingSource2) - 1
GUICtrlSetData($aAlexaGlobalLabel, $aAlexaglobalSource1[$j])
GUICtrlSetData($aAlexaCountryrankingLabel, $aAlexaCountryrankingSource2[$i])
Next
Next

 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...