A
A
alexoka2016-05-19 15:39:50
API
alexoka, 2016-05-19 15:39:50

Again I can not cope with the regular expression, or how to capture the entire json array correctly?

I want to put the answer from api vk in json format into the list without connecting libraries,
etc.

(?<=\{"uid":)([0-9]{1,}),"f.*?(?=})

* {"uid": and the last one } - cut
it turns out to get all the data but the nested data, as in this case
{"uid":32711210,"first_name":"Юрий","last_name":"Коцюбинский","sex":2,"bdate":"15.5.1976","relation":4,"relatives":[{"uid":195139503,"type":"sibling"},{"uid":191446274,"type":"sibling"},{"uid":95498830,"type":"sibling"},{"uid":182441705,"type":"sibling"},{"uid":232168089,"type":"sibling"},{"uid":11080578,"type":"sibling"}]}

they are cut off not at all as it should be - which is not buzzing.
32711210,"first_name":"Юрий","last_name":"Коцюбинский","sex":2,"bdate":"15.5.1976","relation":4,"relatives":[{"uid":195139503,"type":"sibling"

gentlemen, I understand that this is not quite the right method for working with json . but still would love to hear a possible solution

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DarkMatter, 2016-05-19
@alexoka

I don't understand why regular?
php.net/manual/ru/function.json-decode.php
php.net/manual/ru/function.json-encode.php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question