title: Determine rule type in string and parse arguments
body: <p>I have a String containing a filter rule:</p>
  
  <pre><code>String rule = "%john"
  </code></pre>
  
  <p>The available rules types are:</p>
  
  <pre><code>Equal = "value"
  StartsWith = "value%"
  EndsWith = "%value" 
  In = "in(value1,value2,value3)"  
  Range = [min;Max]  
  Min = [min;]  
  Max = [;Max]  
  </code></pre>
  
  <p>Negation: one of the previous with ! before. 
              for example: "![min,Max]"</p>
  
  <p>Given one of this rules how can determine the rule type (equal, range, etc) and get the parameters of that rule (value, min, Max, etc)?</p>
  
  <p>Should I use Regex? I am not very familiar with Regex.</p>