Parsing second identical-type regex



  •     {
          "Id":"2e975cd4-f4ea-4812-8a2c-b4c1efa2b65e","ContactId":"4a3bf844-2f08-76gf-8d99-2f6e5da6b7f8","FullName":"name","Number":"174344079","BonusType":3,"CardType":"\u0411\u043e\u043d\u0443\u0441\u043d\u044b\u0435 \u043a\u0430\u0440\u0442\u044b \u043a \u0437\u0430\u043f\u0443\u0441\u043a\u0443","CardTypeId":"0222619d-5c81-e911-a2b9-001dd8b78fda","StatusDate":"2019-05-28T19:44:00.37","ExpiryDate":"2999-12-31T21:00:00","StatusCode":2,"TechType":100000000,"CollaborationType":3,"Balance":"28.76","ActiveBalance":"28.76","Debet":"192.57","Credit":"163.81","Summ":"8098.28","SummDiscounted":"7501.19","DiscountSumm":"597.09","Discount":"2.00","StatusDebet":"10.00","StatusCredit":"0.00","StatusActiveBalance":"10.00","StatusBalance":"10.00","Quantity":26,"PartnerId":"83af3c07-a3d6-e811-a2b4-001dd8b78fda","PartnerName":"hide","OrgUnitId":null,"OrgUnitName":null,"ModifiedOn":"2019-09-25T23:09:57.773","CardImageUrl":null,"AssistIdentifier":null,"MoneyBalance":"0.00","MoneyCredit":"0.00","MoneyDebet":"0.00","MasterMoneyBalance":null,"MasterActiveBalance":null,"MasterAccountId":null,"MasterAccountCardType":null,"AllowMoneyWriteOff":true,"IsVirtual":false,"LevelId":"3b098862-ca70-e911-a2b8-001dd8b78fda","LevelName":"\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442"
        },{
          "Id":"ba87adca-4aef-40e7-87f8-658ff32f8170","ContactId":"4a3bf844-2f08-4b40-8d99-2f6e5da6b7f8","FullName":"name","Number":"174476827","BonusType":3,"CardType":"\u0411\u043e\u043d\u0443\u0441\u043d\u044b\u0435 \u043a\u0430\u0440\u0442\u044b \u043a \u0437\u0430\u043f\u0443\u0441\u043a\u0443","CardTypeId":"0222619d-5c81-e911-a2b9-001dd8b78fda","StatusDate":"2019-11-15T13:09:13","ExpiryDate":"2999-12-31T21:00:00","StatusCode":2,"TechType":100000000,"CollaborationType":3,"Balance":"0.00","ActiveBalance":"0.00","Debet":"71.15","Credit":"71.15","Summ":"7310.70","SummDiscounted":"7112.70","DiscountSumm":"198.00","Discount":"0.00","StatusDebet":"0.00","StatusCredit":"0.00","StatusActiveBalance":"0.00","StatusBalance":"0.00","Quantity":2,"PartnerId":"83af3c07-a3d6-e811-a2b4-001dd8b78fda","PartnerName":"hide","OrgUnitId":null,"OrgUnitName":null,"ModifiedOn":"2019-11-16T00:00:00","CardImageUrl":null,"AssistIdentifier":null,"MoneyBalance":"0.00","MoneyCredit":"0.00","MoneyDebet":"0.00","MasterMoneyBalance":null,"MasterActiveBalance":null,"MasterAccountId":null,"MasterAccountCardType":null,"AllowMoneyWriteOff":true,"IsVirtual":false,"LevelId":"3b098862-ca70-e911-a2b8-001dd8b78fda","LevelName":"\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442"
        },{
          "Id":"d0acba4d-3535-4b70-947a-709adc0c3814","ContactId":"4a3bf844-2f08-4b40-8d99-2f6e5da6b7f8","FullName":"name","Number":"174534775","BonusType":3,"CardType":"\u0411\u043e\u043d\u0443\u0441\u043d\u044b\u0435 \u043a\u0430\u0440\u0442\u044b \u043a \u0437\u0430\u043f\u0443\u0441\u043a\u0443","CardTypeId":"0222619d-5c81-e911-a2b9-001dd8b78fda","StatusDate":"2019-11-18T10:16:03","ExpiryDate":"2999-12-31T21:00:00","StatusCode":2,"TechType":100000000,"CollaborationType":3,"Balance":"10.95","ActiveBalance":"10.95","Debet":"336.18","Credit":"325.23","Summ":"1403.50","SummDiscounted":"1205.50","DiscountSumm":"198.00","Discount":"0.00","StatusDebet":"10.00","StatusCredit":"0.00","StatusActiveBalance":"10.00","StatusBalance":"10.00","Quantity":2,"PartnerId":"83af3c07-a3d6-e811-a2b4-001dd8b78fda","PartnerName":"hide","OrgUnitId":null,"OrgUnitName":null,"ModifiedOn":"2019-11-19T00:00:00","CardImageUrl":null,"AssistIdentifier":null,"MoneyBalance":"0.00","MoneyCredit":"0.00","MoneyDebet":"0.00","MasterMoneyBalance":null,"MasterActiveBalance":null,"MasterAccountId":null,"MasterAccountCardType":null,"AllowMoneyWriteOff":true,"IsVirtual":false,"LevelId":"3b098862-ca70-e911-a2b8-001dd8b78fda","LevelName":"\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442"
        }
      ]
    }
    
    

    I need parse 2nd or 3rd value of "Number"

    First value I parse with

    PARSE "<SOURCE>" REGEX "\"[0-9]{9}\\\"{1}" "[0]" -> VAR "cardnum" 
    

    How I can do that?


  • Admin

    Tick recursive



  • @Ruri How to specify the sequence number of the desired expression?


  • Admin

    Once you parsed all recursive you get a list that you can access using <MYLIST[index]>



  • @Ruri new question: how can i parse this:

    {
          "Id":"2e975cd4-f4ea-4812-8a2c-b4c1efa2b65e","ContactId":"4a3bf844-2f08-76gf-8d99-2f6e5da6b7f8","FullName":"name","Number":"174344079","BonusType":3,"CardType":"\u0411\u043e\u043d\u0443\u0441\u043d\u044b\u0435 \u043a\u0430\u0440\u0442\u044b \u043a \u0437\u0430\u043f\u0443\u0441\u043a\u0443","CardTypeId":"0222619d-5c81-e911-a2b9-001dd8b78fda","StatusDate":"2019-05-28T19:44:00.37","ExpiryDate":"2999-12-31T21:00:00","StatusCode":2,"TechType":100000000,"CollaborationType":3,"Balance":"28.76","ActiveBalance":"28.76","Debet":"192.57","Credit":"163.81","Summ":"8098.28","SummDiscounted":"7501.19","DiscountSumm":"597.09","Discount":"2.00","StatusDebet":"10.00","StatusCredit":"0.00","StatusActiveBalance":"10.00","StatusBalance":"10.00","Quantity":26,"PartnerId":"83af3c07-a3d6-e811-a2b4-001dd8b78fda","PartnerName":"hide","OrgUnitId":null,"OrgUnitName":null,"ModifiedOn":"2019-09-25T23:09:57.773","CardImageUrl":null,"AssistIdentifier":null,"MoneyBalance":"0.00","MoneyCredit":"0.00","MoneyDebet":"0.00","MasterMoneyBalance":null,"MasterActiveBalance":null,"MasterAccountId":null,"MasterAccountCardType":null,"AllowMoneyWriteOff":true,"IsVirtual":false,"LevelId":"3b098862-ca70-e911-a2b8-001dd8b78fda","LevelName":"\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442"
        }
    

    Need to use regex

    oops, sorry, decided with

    PARSE "<SOURCE>" REGEX "(\\\"Id.*\\s*)\\}" "[0]" Recursive=TRUE -> VAR "info" 
    

Log in to reply