首页 > 解决方案 > 正则表达式以 http 或 https 开头并以 /download 结尾

问题描述

我需要以下正则表达式:

http://必须以或开头https://并且必须以api/file/download

我试过(http:\/\/|https:\/\/)*\/api\/file\/download了:但是这个httt://localhost:4301/api/file/download可以,但这应该被拒绝,因为httt

测试仪

标签: regex

解决方案


用这个:

(http(s?)://(\w)+.\w+/api/file/download)

推荐阅读