title: How do I check a set of data on a set of rules / conditions for categorization?
body: <p>I have a set of bank account entries which I stored in instances of a class <code>bankAccountEntry</code> which I defined. The class <code>bankAccountEntry</code> has the data members </p>
  
  <pre><code>unsigned int year;
  unsigned int month;
  unsigned int day;
  std::string name;
  std::string accountNumberConsidered;
  std::string  accountNumberContra;
  std::string code;
  double amount;
  std::string sortOfMutation;
  std::string note;
  </code></pre>
  
  <p>I want to categorize these bank account entries.</p>
  
  <p>For instance, if the <code>std::string name</code> would contain the substring <code>gasolineStation1</code> or <code>gasolineStation2</code>, it should be categorized under <code>gasoline</code>. To realize this categorization, I could for instance check the data members by means of the statements</p>
  
  <pre><code>if (std::count(bae.name.begin(), bae.name.end(),"gasolineStation1")&gt;0
      || 
      std::count(bae.name.begin(), bae.name.end(),"gasolineStation2")&gt;0)
  {
      bae.setCategory("gasoline");
  }
  </code></pre>
  
  <p>For the categorization of all my bank account entries, I have a large set of such predefined rules / conditions, which I want to give as input argument to the main program.</p>
  
  <p>What strategies are there to check each of my bank account entries for the set of rules / conditions until it finds a hit?</p>