????(?=pattern)?????

12345678???????????12,345,678?

???

???12345678 ???12,345,678
???????3??????“,”?…

??

<script type="text/javascript">
    var s = "12345678";
    alert(s.replace(/(\d)(?=(\d{3})+$)/g, "$1,"));
</script>

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注