JSFiddle - React, Tailwind, and code Playground

HTML

<input type="text" value="5+5" id="test"/>

JavaScript

$(function(){

  ups = {};
  ups['2'] = new Array();
  ups['2']['cmd'] = '#(\-|\+|\*|\/|)[0-9](,|[0-9]|)(\-|\+|\*|\/)[0-9]#gi';     

  var inp_val = $('#test').val();
  if (inp_val.match(ups['2']['cmd']))
  {
     $('body').append('<br />OK');                 
  }

});