title: Generate a dynamic condition to filter the data from user string like min > 0 and max <= 100 - Javascript
body: <p>I have a case like where end user will enter a string in input field like 
  <strong>"(min > 0) and (max &lt;= 100) and (average > 10)"</strong>. I want convert this string into a possible conditions to filter the API response.</p>
  
  <p>For example, my API response will be </p>
  
  <pre><code>{
     "result":{
        "name1":{
           "min":20,
           "max":30,
           "average":15
        },
        "name2":{
           "min":20,
           "max":30,
           "average":15
        },
        "name3":{
           "min":40,
           "max":40,
           "average":20
        },
        "name4":{
           "name":"name4",
           "min":50,
           "max":50,
           "average":25
        }
     }
  }
  </code></pre>
  
  <p>I need the user inputs to converted to a way (like objects) so that I can apply that on the response. I tried using regexp to find the matches but I am not able to do. Please suggest.</p>