Answer the question
In order to leave comments, you need to log in
How to extract text inside brackets?
There is a structure like this:
"item"
{
"inner-item-1" "value"
"inner-item-2" "value"
"inner-item-3" "value"
{
"subitem-1"
}
{
"subitem-2"
}
}
Answer the question
In order to leave comments, you need to log in
SteamDB has a lib for parsing vdf -> https://github.com/SteamDatabase/ValveKeyValue
But I didn't find the docks, either blind or they don't exist. Well, look at the decompiler, what's there like.
find the starting "item" and the parenthesis behind it, remember the position.
declare a variable "counter of brackets" with value = 1
then iterate character by character, counting the number of open brackets, add +1 for each open bracket, subtract for each closed bracket.
when the counter reaches zero - remember the position of the last parenthesis.
take everything between the first and last.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question