JS正则

 1.小括号代表分组

'2017-03-10'.replace(/(d{4})-(d{2})-(d{2})/,'$2/$1/$3');
// "03/2017/10"
原文地址:https://www.cnblogs.com/zuojiayi/p/6530190.html