我嘗試一些事情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