Jump to content

regex finding characters after string doesnt work


Recommended Posts

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 by sonic208
Link to comment
Share on other sites

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 by iamtheky

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

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...