Regex within parenthesis
JavaScript
// Working regex example
// var str1 = "Regex is hard.";
// var patt1 = /is/g;
// alert(str1.match(patt1));
// Non working regex example
var str2 = "This is a string (3444343) with numbers.";
var patt2 = /\((.*?)\)/;
document.write(str2.match(patt2)[1]);
const abc = 'February (02)';
const def = '2023'
const newNum = abc.toString().match(/^[0-9]+(\.[0-9]{1,2})?$/);
document.write(abc.match(patt2)[1]);
document.write(def.substring(2,4));