regex - 正则表达式以 http 或 https 开头并以 /download 结尾
问题描述
我需要以下正则表达式:
http://
必须以或开头https://
并且必须以api/file/download
我试过(http:\/\/|https:\/\/)*\/api\/file\/download
了:但是这个httt://localhost:4301/api/file/download
可以,但这应该被拒绝,因为httt
解决方案
用这个:
(http(s?)://(\w)+.\w+/api/file/download)
推荐阅读
- python-2.7 - 创建多个 python 文件,其中变量设置为列表中的值
- vhdl - 索引一个二维数组元素
- node.js - 如何将 pm2 环境变量传递到节点 repl?
- java - Spring RabbitTemplate 执行方法可见性
- hibernate - Hibernate 更新、PropertyAccessor、ChainedPropertyAccessor、PropertyAccessorFactory 在版本 5.3.7 中不再可用
- function - Elixir,使用另一个模块的函数
- python - Python 列表中的索引包含多个元素。如何访问每个并将它们传递给不同的功能?
- android - 在 IOS 问题上运行 Flutter
- c# - C# Web 窗体应用程序 Sql 命令
- sql - 获取月份第一个日期的值