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

日期:2021-07-29 02:17:31 人气:1

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

匹配1234567890输出1234 56 78 90?

alert('1234567890'.replace(/^(\d{4})(\d{2})(\d{2})(\d{2})$/, '$1 $2 $3 $4'));
    A+
热门评论