作业帮 > 综合 > 作业

用js正则匹配1234567890出1234 56 78 90 我写的是var re=/(\d{4})(\d{2})(\

来源:学生作业帮 编辑:大师作文网作业帮 分类:综合作业 时间:2024/11/10 16:13:21
用js正则匹配1234567890出1234 56 78 90 我写的是var re=/(\d{4})(\d{2})(\d{2})(\d{2})/
求一个更简单的写法,
用js正则匹配1234567890出1234 56 78 90 我写的是var re=/(\d{4})(\d{2})(\
匹配1234567890输出1234 56 78 90?
alert('1234567890'.replace(/^(\d{4})(\d{2})(\d{2})(\d{2})$/, '$1 $2 $3 $4'));