SOURCE

var pattern = /(?<=wpf).*?(?=wpd)/,
	str = 'wpf123234344wpd';
console.log(str.match(pattern));
console.log(str.replace(`wpf${str.match(pattern)[0]}wpd`,'22'))
console 命令行工具 X clear

                    
>
console