title: Ruby on rails: Substring with quotes search inside JSON object
body: <p>I have retrieved a json object using typhoeus gem.</p>
  
  <pre><code>url = 'www.example.com' &lt;br&gt;
  request = ::Typhoeus::Request.get(url,userpwd: username + ":" + pass)&lt;br&gt; 
  content = JSON.parse(request.body)
  </code></pre>
  
  <p>I would like to count the occurence of "Priority":"high" including the quotes inside the json response. How do I go about doing this?<br><br><br>
  Edit:<br>
  "priority":"high" is a key value pair. It is deeply nested inside the json tree.(Don't how deeply it is nested). All I need is count of occurence of "priority":"high"<br><br>
  Any and all suggestion is welcome.</p>
  
  <p><br><br>
  Sample data: <br>
  "tickets": [{
      "url": "<a href="https://.zendesk.com/api/v2/tickets/xxxx.json" rel="nofollow">https://.zendesk.com/api/v2/tickets/xxxx.json</a>",
      "id": xxxxx,
      "external_id": null,
      "via": {
        "channel": "email",
        "source": {
          "from": {
            "address": "@compli.com",
            "name": ""
          },
          "to": {
            "name": "organization Global Support",
            "address": "support@organization.zendesk.com"
          },
          "rel": null
        }
      },
      "created_at": "2016-08-04T16:23:13Z",
      "updated_at": "2016-08-08T20:26:01Z",
      "type": "problem",
      "subject": "Problems with abc Connect",
      "raw_subject": "Problems with abc Connect",
      "description": "Hi – our Tenet ID is 5675.\n\n \n\nThe abc report is not providing the full data when I run the billing preview. I am running it using Chrome. Attached are snapshots of what I’m doing plus the report generated.\n\n \n\nA perfect example of the problem is shown at the bottom of the report generated. Garber Automotive Group, account number A00000490 does not display the data for all of their products. Their data is shown on rows 5658 thru 5712 on the excel file BillingPreviewResult_201620 report run 08.04.16.\n\n \n\nHowever the EXACT same report (all the parameters are the same) run on 07/01/16 included all of Garber’s information. The excel file abc report run 07.01.16 10.13 AM has the data for Garber on rows 6099 – 6182.\n\n \n\nThe report is cutting off a lot of data for some reason. As you can see by comparing the amount of data between the two excel reports there are much fewer lines on the report run on today as opposed to the one run on 07/01, 6182 rows vs 5712 rows.\n\n \n\nThis is a business critical report for us. It is used for cash forecasting, monthly financial reporting, rolling budgeting and ad hoc reporting.\n\n \n\nWe need this problem identified and fixed immediately. It is already causing a problem with finalizing our July results.\n\n \n\nLet me know if you have any questions or need any additional data.\n\n \n\n \n\nRegards,\n\n \n\n \n\n \n\n| Controller\ndesk: 503.963-4239 | fax: 503.294.1200 |  \n\nCompli - Cool, Calm and Compliant. TM\n\nVisit() to learn more.\n\n \n\nFollow us on LinkedIn () and Twitter",
      "priority": "normal",
      "status": "open",
      "recipient": "support@organization.zendesk.com",
      "requester_id": 1336424406,
      "submitter_id": 1336424406,
      "assignee_id": null,
      "organization_id": 224504969,
      "group_id": 21606503,
      "collaborator_ids": [560973773, 786229209, 421597631, 539566717, 707192615, 1336424406, 31365392, 719608577, 1817633993],
      "forum_topic_id": null,
      "problem_id": null,
      "has_incidents": false,
      "due_at": null,
      "tags": ["1_price", "best_practice_advise", "engage_global_services__email_", "escalate", "hard", "internal_escalation", "p0", "yes_escalated", "xxxxx", "zhub"],
      "custom_fields": [{
        "id": 22024091,
        "value": "p0"
      }, {
        "id": 24212576,
        "value": "best_practice_advise"
      }, {
        "id": 22035048,
        "value": "xxx     and so on.....</p>