Regular matching percentage code under JavaScript

Time:2021-10-16

<script language=”javascript”>
    var re = /^-?\d+%$/;
    alert(re.test(‘50%’));
    alert(re.test(‘-25%’));
    alert(re.test(‘3a5%’));
</script>

Recommended Today

SQL exercise 20 – Modeling & Reporting

This blog is used to review and sort out the common topic modeling architecture, analysis oriented architecture and integration topic reports in data warehouse. I have uploaded these reports to GitHub. If you are interested, you can have a lookAddress:https://github.com/nino-laiqiu/TiTanI recorded a relatively complete development process in my hexo blog deployed on GitHub. You can […]