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