const regex = /(.*)\/([^.]+)(.*)/i;
// Alternative syntax using RegExp constructor
// const regex = new RegExp('(.*)\\\/([^.]+)(.*)', 'i')
const str = `https://776fd56e08b58f28e0c93aa2aedd9b8ab5c11431.googledrive.com/host/0B_8okaqRyPERVlM0OVVCS29TVzQ/1706-16902-22220.png`;
const subst = `$1$2_thumbnail$3`;
// The substituted value will be contained in the result variable
const result = str.replace(regex, subst);
console.log('Substitution result: ', result);
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for JavaScript, please visit: https://developer.mozilla.org/en/docs/Web/JavaScript/Guide/Regular_Expressions