asked on December 12, 2017
•
Show version history
I am trying to use Regex to remove round brackets and whatever is inbetween them.
Sample string - Chess Club (ID:CHESS)
Sample string - Table Tennis (ID:TAB T)
//Regex SUKEY $(document).ready(function () { var re = new RegExp("(.*\\b)\(ID:.*\)"); $('#q137 input').on('change', function() { var pm = $(this).val().match(re); $('#q138 input').val(pm[1]).trigger('change'); }); })
Returns the value - Chess Club (
0
0