I have a string and I wrote following code to extract "NewUsers19" from that.
function getNoOfUsers() {
var noSpace = "UserRejectedOrderCount25NewUsers19FundedNewUsers14DepositAmount($)43165.23DepositCount75WithdrawAmount($)53510";
var regex = /(?:NewUsers)([0-9]+)/;
var value = regex.exec(noSpace);
return value;
}
The regex worked fine in online editors but I don't know why it does not work in Google App Script. Any help will be appreciated.