我有一个像这样的简单域名:https://example.com/
我希望将它与可能与之完全匹配的字符串匹配。
其他变体可能包括:
https://example.com/1234567890/
https://example.com/subdomain/subdomain2
https://example.com/domain
等
我想匹配确切的域但不告诉它字符串的开始或结束位置。
我试过:https:\/\/example\.com\/[^.]
希望在字符串之后否定任何内容,或https:\/\/example\.com\/(?!.)
否定前瞻但这似乎不起作用所以我现在迷失了。
我需要一个仅与此列表中的https://example.com/
匹配的正则表达式:
https://example.com/
https://example.com/1234567890/
https://example.com/subdomain/subdomain2
https://example.com/domain