<script language="javascript">
var re = /^-?\d+%$/;
alert(re.test('50%'));
alert(re.test('-25%'));
alert(re.test('3a5%'));
</script>
时间: 2024-09-28 23:50:58
<script language="javascript">
var re = /^-?\d+%$/;
alert(re.test('50%'));
alert(re.test('-25%'));
alert(re.test('3a5%'));
</script>