您现在的位置是:首页 > 电脑技术查询 > web开发

如何获取 字符串后面的数字

编辑:chaxungu时间:2022-10-02 23:23:18分类:web开发

怎么获取 字符串后面的数字?
比如 sss13 我想取13

但是13 不固定,有可能是999,字符串长度也不固定,唯一固定的是 数字肯定在后面



------解决方案--------------------
<script type= "text/javascript ">
var str= "sss123sss ";
var re=/[0-9]+/g;
alert(str.match(re));
</script>