标签: javascript regex pattern-matching
我需要一个正则表达式来验证给定的值是没有ascii或特殊字符的URL或URI。
如此有效的方案:
无效方案:
https://stackoverflow.com/questions/ask/@#$ds ### (without spaces)
如何使用正则表达式来实现?
答案 0 :(得分:0)
我想说这是一个很好的起点
^[https:\/\/|http:\/\/]?(www\.)?[-a-zA-Z0-9\.\/]+$
您的局限性尚不完全清楚
^
$