要是格式固定直接字符串位数分割最方便了 let [str, year, month, day] = '20190619'.match(/^(\d{4})(\d{2})(\d{2})$/); console.log(`${year}年${month}月${day}日`);
要是格式固定直接字符串位数分割最方便了