Помогите с регуляркой



  • instanceid":"[[FOREACH_DATA]].*","market_hash_name":"(\d+)-
    Пытаюсь получить market_hash_name через переменную [[FOREACH_DATA]]

    instanceid":"246376127","icon_url":"IzMF03bk9WpSBq-S-ekoE33L-iLqGFHVaU25ZzQNQcXdA3g5gMEPvUZZEfSbPLNbSM0v_2SVTY7V2NoPx3AFmChCIzb02ClccOxgNNKNhVet6tOYHXrjZzmCJizYG1s1GOVZM2-KrDugsOXBETnPReElRg0Af6NQ-jJLO8qBbBBv04ZYrTXszgptEBFucMpUdAqp9X0eMLoglSRLJJNSkSz2IJ2P0Ak0PUM-CLjkAO3GatOtkyojXUg1F_NIMIuX6nTyuMmmfLGLL7Qyj08D","icon_url_large":"IzMF03bk9WpSBq-S-ekoE33L-iLqGFHVaU25ZzQNQcXdA3g5gMEPvUZZEfSbPLNbSM0v_2SVTY7V2NoPx3AFmChCIzb02ClccOxgNNKNhVet6tOYHXrjZzmCJizYG1s1GOVZM2-KrDugsOXBETnPReElRg0Af6NQ-jJLO8qBbBBv04ZYrTXszgptEBFucMpUdAqp9X0eMLoglSRLJJNSkSz2IJ2P0Ak0PUM-CLjkAO3GatOtkyojXUg1F_NIMIuX6nTyuMmmfLGLL7Qyj08D","icon_drag_url":"","name":"Quilly & Quanton (Коллекционная карточка)","market_hash_name":"303390-



  • @Ashir said in Помогите с регуляркой:

    instanceid":"[[FOREACH_DATA]].*","market_hash_name":"(\d+)-
    Пытаюсь получить market_hash_name через переменную [[FOREACH_DATA]]

    instanceid":"246376127","icon_url":"IzMF03bk9WpSBq-S-ekoE33L-iLqGFHVaU25ZzQNQcXdA3g5gMEPvUZZEfSbPLNbSM0v_2SVTY7V2NoPx3AFmChCIzb02ClccOxgNNKNhVet6tOYHXrjZzmCJizYG1s1GOVZM2-KrDugsOXBETnPReElRg0Af6NQ-jJLO8qBbBBv04ZYrTXszgptEBFucMpUdAqp9X0eMLoglSRLJJNSkSz2IJ2P0Ak0PUM-CLjkAO3GatOtkyojXUg1F_NIMIuX6nTyuMmmfLGLL7Qyj08D","icon_url_large":"IzMF03bk9WpSBq-S-ekoE33L-iLqGFHVaU25ZzQNQcXdA3g5gMEPvUZZEfSbPLNbSM0v_2SVTY7V2NoPx3AFmChCIzb02ClccOxgNNKNhVet6tOYHXrjZzmCJizYG1s1GOVZM2-KrDugsOXBETnPReElRg0Af6NQ-jJLO8qBbBBv04ZYrTXszgptEBFucMpUdAqp9X0eMLoglSRLJJNSkSz2IJ2P0Ak0PUM-CLjkAO3GatOtkyojXUg1F_NIMIuX6nTyuMmmfLGLL7Qyj08D","icon_drag_url":"","name":"Quilly & Quanton (Коллекционная карточка)","market_hash_name":"303390-

    Приведите строку целиком, необходимые данные проще получить через модуль JSON



  • @Fox {"success":true,"rgInventory":{"18294208406":{"id":"18294208406","classid":"503774026","instanceid":"246376127","amount":"1","hide_in_china":1,"pos":1},"18293986073":{"id":"18293986073","classid":"503781788","instanceid":"246376127","amount":"1","hide_in_china":1,"pos":2}},"rgCurrency":[],"rgDescriptions":{"503774026_246376127":{"appid":"753","classid":"503774026","instanceid":"246376127","icon_url":"IzMF03bk9WpSBq-S-ekoE33L-iLqGFHVaU25ZzQNQcXdA3g5gMEPvUZZEfSbPLNbSM0v_2SVTY7V2NoPx3AFmChCIzb02ClccORiLMTIhgz2oOWIQXXzPGSSLXOAGAZuS-YKYzrQrWH24ruVSjnPEOl4RlwHf6RVoWxIOsGXf0xqwtVUuWG9hXt0Excvd5hDKQ7jmixLZ-t8ziQUI85XzXbwJcKIgVowYEVvXbi1BLSRPdWlkn11Q1o5SLZcaYmdUVPnJA","icon_url_large":"IzMF03bk9WpSBq-S-ekoE33L-iLqGFHVaU25ZzQNQcXdA3g5gMEPvUZZEfSbPLNbSM0v_2SVTY7V2NoPx3AFmChCIzb02ClccORiLMTIhgz2oOWIQXXzPGSSLXOAGAZuS-YKYzrQrWH24ruVSjnPEOl4RlwHf6RVoWxIOsGXf0xqwtVUuWG9hXt0Excvd5hDKQ7jmixLZ-t8ziQUI85XzXbwJcKIgVowYEVvXbi1BLSRPdWlkn11Q1o5SLZcaYmdUVPnJA","icon_drag_url":"","name":"Quanton (Коллекционная карточка)","market_hash_name":"303390-Quanton (Trading Card)","market_name":"Quanton (Коллекционная карточка)","name_color":"","background_color":"","type":"Коллекционная карточка из Dead Bits","tradable":1,"marketable":1,"commodity":1,"market_fee_app":"303390","market_tradable_restriction":"7","market_marketable_restriction":"7","descriptions":[{"value":"Quanton is the ruler of all galaxies.\r\nHe studies species from the universe."}],"tags":[{"internal_name":"droprate_0","name":"Обычный","category":"droprate","category_name":"Редкость"},{"internal_name":"app_303390","name":"Dead Bits","category":"Game","category_name":"Игра"},{"internal_name":"cardborder_0","name":"Обычная","category":"cardborder","category_name":"Оформление карточки"},{"internal_name":"item_class_2","name":"Коллекционная карточка","category":"item_class","category_name":"Тип предмета"}]},"503781788_246376127":{"appid":"753","classid":"503781788","instanceid":"246376127","icon_url":"IzMF03bk9WpSBq-S-ekoE33L-iLqGFHVaU25ZzQNQcXdA3g5gMEPvUZZEfSbPLNbSM0v_2SVTY7V2NoPx3AFmChCIzb02ClccOxgNNKNhVet6tOYHXrjZzmCJizYG1s1GOVZM2-KrDugsOXBETnPReElRg0Af6NQ-jJLO8qBbBBv04ZYrTXszgptEBFucMpUdAqp9X0eMLoglSRLJJNSkSz2IJ2P0Ak0PUM-CLjkAO3GatOtkyojXUg1F_NIMIuX6nTyuMmmfLGLL7Qyj08D","icon_url_large":"IzMF03bk9WpSBq-S-ekoE33L-iLqGFHVaU25ZzQNQcXdA3g5gMEPvUZZEfSbPLNbSM0v_2SVTY7V2NoPx3AFmChCIzb02ClccOxgNNKNhVet6tOYHXrjZzmCJizYG1s1GOVZM2-KrDugsOXBETnPReElRg0Af6NQ-jJLO8qBbBBv04ZYrTXszgptEBFucMpUdAqp9X0eMLoglSRLJJNSkSz2IJ2P0Ak0PUM-CLjkAO3GatOtkyojXUg1F_NIMIuX6nTyuMmmfLGLL7Qyj08D","icon_drag_url":"","name":"Quilly & Quanton (Коллекционная карточка)","market_hash_name":"303390-Quilly & Quanton (Trading Card)","market_name":"Quilly & Quanton (Коллекционная карточка)","name_color":"","background_color":"","type":"Коллекционная карточка из Dead Bits","tradable":1,"marketable":1,"commodity":1,"market_fee_app":"303390","market_tradable_restriction":"7","market_marketable_restriction":"7","descriptions":[{"value":"This was the first time that Quilly saw another creature in his life."}],"tags":[{"internal_name":"droprate_0","name":"Обычный","category":"droprate","category_name":"Редкость"},{"internal_name":"app_303390","name":"Dead Bits","category":"Game","category_name":"Игра"},{"internal_name":"cardborder_0","name":"Обычная","category":"cardborder","category_name":"Оформление карточки"},{"internal_name":"item_class_2","name":"Коллекционная карточка","category":"item_class","category_name":"Тип предмета"}]}},"more":false,"more_start":false}



  • @Ashir Для безопасной вставки кода на форуме присутсвует специальная кнопочка: ac79a078-f3d7-42df-9147-187fbeb004cf-изображение.png . А во вторых вы не указали какие данные вы хотите получить



  • This post is deleted!




  • @Fox ```
    Пытаюсь получить market_hash_name, где instanceid":"[[FOREACH_DATA]]"

    {"success":true,"rgInventory":{"18294208406":{"id":"18294208406","classid":"503774026","instanceid":"246376127","amount":"1","hide_in_china":1,"pos":1},"18293986073":{"id":"18293986073","classid":"503781788","instanceid":"246376127","amount":"1","hide_in_china":1,"pos":2}},"rgCurrency":[],"rgDescriptions":{"503774026_246376127":{"appid":"753","classid":"503774026","instanceid":"246376127","icon_url":"IzMF03bk9WpSBq-S-ekoE33L-iLqGFHVaU25ZzQNQcXdA3g5gMEPvUZZEfSbPLNbSM0v_2SVTY7V2NoPx3AFmChCIzb02ClccORiLMTIhgz2oOWIQXXzPGSSLXOAGAZuS-YKYzrQrWH24ruVSjnPEOl4RlwHf6RVoWxIOsGXf0xqwtVUuWG9hXt0Excvd5hDKQ7jmixLZ-t8ziQUI85XzXbwJcKIgVowYEVvXbi1BLSRPdWlkn11Q1o5SLZcaYmdUVPnJA","icon_url_large":"IzMF03bk9WpSBq-S-ekoE33L-iLqGFHVaU25ZzQNQcXdA3g5gMEPvUZZEfSbPLNbSM0v_2SVTY7V2NoPx3AFmChCIzb02ClccORiLMTIhgz2oOWIQXXzPGSSLXOAGAZuS-YKYzrQrWH24ruVSjnPEOl4RlwHf6RVoWxIOsGXf0xqwtVUuWG9hXt0Excvd5hDKQ7jmixLZ-t8ziQUI85XzXbwJcKIgVowYEVvXbi1BLSRPdWlkn11Q1o5SLZcaYmdUVPnJA","icon_drag_url":"","name":"Quanton (Коллекционная карточка)","market_hash_name":"303390-Quanton (Trading Card)","market_name":"Quanton (Коллекционная карточка)","name_color":"","background_color":"","type":"Коллекционная карточка из Dead Bits","tradable":1,"marketable":1,"commodity":1,"market_fee_app":"303390","market_tradable_restriction":"7","market_marketable_restriction":"7","descriptions":[{"value":"Quanton is the ruler of all galaxies.\r\nHe studies species from the universe."}],"tags":[{"internal_name":"droprate_0","name":"Обычный","category":"droprate","category_name":"Редкость"},{"internal_name":"app_303390","name":"Dead Bits","category":"Game","category_name":"Игра"},{"internal_name":"cardborder_0","name":"Обычная","category":"cardborder","category_name":"Оформление карточки"},{"internal_name":"item_class_2","name":"Коллекционная карточка","category":"item_class","category_name":"Тип предмета"}]},"503781788_246376127":{"appid":"753","classid":"503781788","instanceid":"246376127","icon_url":"IzMF03bk9WpSBq-S-ekoE33L-iLqGFHVaU25ZzQNQcXdA3g5gMEPvUZZEfSbPLNbSM0v_2SVTY7V2NoPx3AFmChCIzb02ClccOxgNNKNhVet6tOYHXrjZzmCJizYG1s1GOVZM2-KrDugsOXBETnPReElRg0Af6NQ-jJLO8qBbBBv04ZYrTXszgptEBFucMpUdAqp9X0eMLoglSRLJJNSkSz2IJ2P0Ak0PUM-CLjkAO3GatOtkyojXUg1F_NIMIuX6nTyuMmmfLGLL7Qyj08D","icon_url_large":"IzMF03bk9WpSBq-S-ekoE33L-iLqGFHVaU25ZzQNQcXdA3g5gMEPvUZZEfSbPLNbSM0v_2SVTY7V2NoPx3AFmChCIzb02ClccOxgNNKNhVet6tOYHXrjZzmCJizYG1s1GOVZM2-KrDugsOXBETnPReElRg0Af6NQ-jJLO8qBbBBv04ZYrTXszgptEBFucMpUdAqp9X0eMLoglSRLJJNSkSz2IJ2P0Ak0PUM-CLjkAO3GatOtkyojXUg1F_NIMIuX6nTyuMmmfLGLL7Qyj08D","icon_drag_url":"","name":"Quilly & Quanton (Коллекционная карточка)","market_hash_name":"303390-Quilly & Quanton (Trading Card)","market_name":"Quilly & Quanton (Коллекционная карточка)","name_color":"","background_color":"","type":"Коллекционная карточка из Dead Bits","tradable":1,"marketable":1,"commodity":1,"market_fee_app":"303390","market_tradable_restriction":"7","market_marketable_restriction":"7","descriptions":[{"value":"This was the first time that Quilly saw another creature in his life."}],"tags":[{"internal_name":"droprate_0","name":"Обычный","category":"droprate","category_name":"Редкость"},{"internal_name":"app_303390","name":"Dead Bits","category":"Game","category_name":"Игра"},{"internal_name":"cardborder_0","name":"Обычная","category":"cardborder","category_name":"Оформление карточки"},{"internal_name":"item_class_2","name":"Коллекционная карточка","category":"item_class","category_name":"Тип предмета"}]}},"more":false,"more_start":false}


  • @prorok Мне нужен не рандомный market_hash_name
    а с определенным instanceid, instanceid в переменной [[FOREACH_DATA]]



  • @Ashir said in Помогите с регуляркой:

    @Fox ```
    Пытаюсь получить market_hash_name, где instanceid":"[[FOREACH_DATA]]"

    {"success":true,"rgInventory":{"18294208406":{"id":"18294208406","classid":"503774026","instanceid":"246376127","amount":"1","hide_in_china":1,"pos":1},"18293986073":{"id":"18293986073","classid":"503781788","instanceid":"246376127","amount":"1","hide_in_china":1,"pos":2}},"rgCurrency":[],"rgDescriptions":{"503774026_246376127":{"appid":"753","classid":"503774026","instanceid":"246376127","icon_url":"IzMF03bk9WpSBq-S-ekoE33L-iLqGFHVaU25ZzQNQcXdA3g5gMEPvUZZEfSbPLNbSM0v_2SVTY7V2NoPx3AFmChCIzb02ClccORiLMTIhgz2oOWIQXXzPGSSLXOAGAZuS-YKYzrQrWH24ruVSjnPEOl4RlwHf6RVoWxIOsGXf0xqwtVUuWG9hXt0Excvd5hDKQ7jmixLZ-t8ziQUI85XzXbwJcKIgVowYEVvXbi1BLSRPdWlkn11Q1o5SLZcaYmdUVPnJA","icon_url_large":"IzMF03bk9WpSBq-S-ekoE33L-iLqGFHVaU25ZzQNQcXdA3g5gMEPvUZZEfSbPLNbSM0v_2SVTY7V2NoPx3AFmChCIzb02ClccORiLMTIhgz2oOWIQXXzPGSSLXOAGAZuS-YKYzrQrWH24ruVSjnPEOl4RlwHf6RVoWxIOsGXf0xqwtVUuWG9hXt0Excvd5hDKQ7jmixLZ-t8ziQUI85XzXbwJcKIgVowYEVvXbi1BLSRPdWlkn11Q1o5SLZcaYmdUVPnJA","icon_drag_url":"","name":"Quanton (Коллекционная карточка)","market_hash_name":"303390-Quanton (Trading Card)","market_name":"Quanton (Коллекционная карточка)","name_color":"","background_color":"","type":"Коллекционная карточка из Dead Bits","tradable":1,"marketable":1,"commodity":1,"market_fee_app":"303390","market_tradable_restriction":"7","market_marketable_restriction":"7","descriptions":[{"value":"Quanton is the ruler of all galaxies.\r\nHe studies species from the universe."}],"tags":[{"internal_name":"droprate_0","name":"Обычный","category":"droprate","category_name":"Редкость"},{"internal_name":"app_303390","name":"Dead Bits","category":"Game","category_name":"Игра"},{"internal_name":"cardborder_0","name":"Обычная","category":"cardborder","category_name":"Оформление карточки"},{"internal_name":"item_class_2","name":"Коллекционная карточка","category":"item_class","category_name":"Тип предмета"}]},"503781788_246376127":{"appid":"753","classid":"503781788","instanceid":"246376127","icon_url":"IzMF03bk9WpSBq-S-ekoE33L-iLqGFHVaU25ZzQNQcXdA3g5gMEPvUZZEfSbPLNbSM0v_2SVTY7V2NoPx3AFmChCIzb02ClccOxgNNKNhVet6tOYHXrjZzmCJizYG1s1GOVZM2-KrDugsOXBETnPReElRg0Af6NQ-jJLO8qBbBBv04ZYrTXszgptEBFucMpUdAqp9X0eMLoglSRLJJNSkSz2IJ2P0Ak0PUM-CLjkAO3GatOtkyojXUg1F_NIMIuX6nTyuMmmfLGLL7Qyj08D","icon_url_large":"IzMF03bk9WpSBq-S-ekoE33L-iLqGFHVaU25ZzQNQcXdA3g5gMEPvUZZEfSbPLNbSM0v_2SVTY7V2NoPx3AFmChCIzb02ClccOxgNNKNhVet6tOYHXrjZzmCJizYG1s1GOVZM2-KrDugsOXBETnPReElRg0Af6NQ-jJLO8qBbBBv04ZYrTXszgptEBFucMpUdAqp9X0eMLoglSRLJJNSkSz2IJ2P0Ak0PUM-CLjkAO3GatOtkyojXUg1F_NIMIuX6nTyuMmmfLGLL7Qyj08D","icon_drag_url":"","name":"Quilly & Quanton (Коллекционная карточка)","market_hash_name":"303390-Quilly & Quanton (Trading Card)","market_name":"Quilly & Quanton (Коллекционная карточка)","name_color":"","background_color":"","type":"Коллекционная карточка из Dead Bits","tradable":1,"marketable":1,"commodity":1,"market_fee_app":"303390","market_tradable_restriction":"7","market_marketable_restriction":"7","descriptions":[{"value":"This was the first time that Quilly saw another creature in his life."}],"tags":[{"internal_name":"droprate_0","name":"Обычный","category":"droprate","category_name":"Редкость"},{"internal_name":"app_303390","name":"Dead Bits","category":"Game","category_name":"Игра"},{"internal_name":"cardborder_0","name":"Обычная","category":"cardborder","category_name":"Оформление карточки"},{"internal_name":"item_class_2","name":"Коллекционная карточка","category":"item_class","category_name":"Тип предмета"}]}},"more":false,"more_start":false}
    

    Действие "Получить значение" с кодом:

    [?(@.instanceid == "[[FOREACH_DATA]]")].market_hash_name
    


  • @Fox Спасибо большое!


Log in to reply