youtuber

Getting data from source code with regex?

4 posts in this topic




#2 ·  Posted

"us":(\d+).*"global":(\d+)

https://regex101.com/r/l4icdQ/2 :)

1 person likes this

AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

Some messages & Apologizes:

If I hurt you, Please accept my apologies, I never (regardless of the situation) mean to hurt anybody!!!

Also, I am very busy with my project so I will appear in the last row of the online list, if you want to contact me: Email@TheDcoder.xyz

Or you can have a nice chat with me in freenode, I use the same nick on freenode too!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites

#3 ·  Posted

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

_ArrayDisplay($a)

 

1 person likes this

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!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

#4 ·  Posted

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

 

Share this post


Link to post
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