regex以http或https开头,以/download结尾

regex以http或https开头,以/download结尾,regex,Regex,我需要regex用于以下内容: 必须以http://或https://开头,并且必须以api/file/download 我试过像这样:(http:\/\/\124; https:\/\/)*\/api\/file\/download,但是用这个httt://localhost:4301/api/file/download给出ok,但由于httt 使用以下方法: (http(s?)://(\w)+.\w+/api/file/download) *表示“零次或多次”,因此您的比赛实际上不需要从这

我需要regex用于以下内容:

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

我试过像这样:
(http:\/\/\124; https:\/\/)*\/api\/file\/download
,但是用这个
httt://localhost:4301/api/file/download
给出ok,但由于
httt

使用以下方法:

(http(s?)://(\w)+.\w+/api/file/download)
*表示“零次或多次”,因此您的比赛实际上不需要从这两个选项中的任何一个开始。而且似乎没有必要重复整个过程,只需使用
https?:\/\/