l例如匹配數據中包含 ${ 開頭 ,}$ 結尾的正則表達式
只要在數據中存在${ }$,無論 ${ 前面有沒有數據,}$ 后面有沒有數據,或者${ 中間 }$,中間是什么,都會匹配到
案例:const rex = /(\$\{)[\s\S]*(\}\$)/g;
const a ='xxxxxxxwerh34567bvfd345yuuhgf';
const b = 'xvcdfg${xxxxxxx}$s23456ygfd';
rex.test(a) //false
rex.test(a) //true
延伸 [\s\S]* 任何字符無論多少個