title: jQuery: Access sum of a string of numbers with specific date and text
body: <p>I have this string: </p>
  
  <pre><code>var result = " / 07-09-2012 73 ABC / 11-09-2012 195 DEF/ 03-09-2012 95 / 04-09-2012 188 ABC / 31-10-2012 72 / 18-09-2012 205 / 26-09-2012 244 ABC / 14-09-2012 86 / 20-09-2012 92 DEF / 28-09-2012 97 / 01-09-2012 95 DEF/ 17-09-2012 95 / 17-09-2012 83 / 12-09-2012 95 / 18-09-2012 95 ABC / 18-09-2012 69 / 21-09-2012 95 / 21-09-2012 95 ABC/ 24-09-2012 144 / 28-09-2012 93 DEF";
  </code></pre>
  
  <p>The string is divided in 3 categories. </p>
  
  <ol>
  <li>Date (dd/mm/yyyy) </li>
  <li>Number</li>
  <li>Character</li>
  </ol>
  
  <p>thus: <strong>07-09-2012 73 ABC</strong></p>
  
  <p>I want to get the sum of number, where date is 09 and has character ABC.</p>
  
  <p>Currently, from another question I found out how to retrieve just the date, when string has no characters
  Example: <a href="http://jsfiddle.net/javascript/pBNNt/10/" rel="noreferrer">http://jsfiddle.net/javascript/pBNNt/10/</a></p>
  
  <pre><code>var result = " / 07-09-2012 73 / 11-09-2012 195 / 03-09-2012 95 / 04-09-2012 188 / 31-10-2012 72 / 18-09-2012 205 / 26-09-2012 244 / 14-09-2012 86 / 20-09-2012 92 / 28-09-2012 97 / 01-09-2012 95 / 17-09-2012 95 / 17-09-2012 83 / 12-09-2012 95 / 18-09-2012 95 / 18-09-2012 69 / 21-09-2012 95 / 21-09-2012 95 / 24-09-2012 144 / 28-09-2012 93";
  
  var resultArr = result.split('/');
  var results = {}; //sum by month
  for (var i = 0; i &lt; resultArr.length; i++) {    
      if ( resultArr[i].length &gt;= 11) { //it has date
          var resultTkn = resultArr[i].split(' ');
  
          if (resultTkn[1].length == 10) { //it is a date
              var date = resultTkn[1].split('-');
              var sum = 0;
              if (results.hasOwnProperty(date[1])) {
                  sum = results[date[1]];
              }
  
              sum += parseFloat(resultTkn[2]);
              results[date[1]] = sum;
          }
      }
  }
  $('div').text(results["09"])
  </code></pre>
  
  <p>​</p>
  
  <p>Now how can I do the same, <strong>but retrieve the sum of a specific date or month, with the specific character.</strong></p>
  
  <p>Here is my current fiddle with the string: <a href="http://jsfiddle.net/javascript/pBNNt/8/" rel="noreferrer">http://jsfiddle.net/javascript/pBNNt/8/</a></p>
  
  <p>Something like: <code>results["09/2012,ABC"]</code></p>