JSFiddle - React, Tailwind, and code Playground

by Graham Fairweather

JavaScript

var str1 = "this is (1) test",
    str2 = "this is (2) test",
    str3 = str1.match(/\((.*?)\)/)[1] + str2.match(/\((.*?)\)/)[1];

alert(str3);