我尝试一些事情regex'es,我想知道如何做到以下几点: 接受:正则表达式 - 可选,需要
http://google.com
https://google.com
http://google.com/
https://google.com/
http://google.com/*
https://google.com/*
http://*.google.com
https://*.google.com
http://*.google.com/
https://*.google.com/
http://*.google.com/*
https://*.google.com/*
的子域通配符只能包含[AZ] [AZ] [ 0-9]并且是可选的,但是如果它在需要之后存在点。
我就尽可能:
https?://(www.)google.com/
但我认为这是不工作的正确方法......只有WWW。是可用的。 我希望有人能够给我所需的结果,并解释它为什么这样工作。
感谢,
丹尼斯
你想要匹配什么? – nicooga