rotate(49deg) //这是要被处理的字符串
49 //这是要处理成的样子
我对js正则不太熟悉,还请专业人员指教
rotate(49deg) //这是要被处理的字符串
49 //这是要处理成的样子
我对js正则不太熟悉,还请专业人员指教
<!DOCTYPE html>
<html>
<head>
<script type = "text/javascript">
function getNumList(){
var nums = document.getElementById('numbers').value;
var reg = /[1-9][0-9]*/g;
var numList = nums.match(reg);
if(numList == null)
document.getElementById('result').innerHTML = "NO LEGAL NUMBER INPUT";
else
document.getElementById('result').innerHTML = numList.join(',');
}
</script>
</head>
<body>
<B>GET NUMBERS</B>
<br>
<br>
<input type= "text" id = 'numbers' value = '' />
<input type = 'button' value = "exec" onclick = 'getNumList()'/>
<br>
<br>
<B>result:<B> <b id = 'result'></b>
</body>
</html>