title: .test() method is not working in react jsx code
body: <p>I'm using .test() method to check the input value from the text box is matching with regex in my react app, below is my code</p>
  
  <pre><code>if(!((data.regex_tx).test(value))){
          message = &lt;p style={{color:'red',marginTop:-15}}&gt;{data.vld_msg}&lt;/p&gt;
    }
  </code></pre>
  
  <p>where data.regex = regex from json, value = input value from textbox and data.vld_msg=validation message from json to be displayed. Getting console error  " Uncaught TypeError: data.regex_tx.test is not a function(…)". Anything wrong in the syntax. Kindly help </p>