2017-04-11 49 views
-2

表達什麼是正則表達式爲:定期對某些URL

https://lenovo:44333

雖然44333是不可能改變 - 只是想確保用戶類型這在W/O錯誤...

+0

哪部分是不變的? – qxg

+0

不變爲https。這將工作:http:// [AZ] [az]。*:[0-9]。* –

回答

1

你可以試試這個

((http|https):\/{2})+([a-zA-Z]+\:[0-9]*)+

http://regexr.com/3fnjt

enter image description here

或每@PSGuy

https?:\/{2}[A-Za-z]+\:[0-9]*

enter image description here

+1

這也適用:'https?:\/{2} [A-Za-z] + \:[0 -9] *'。我相信正則表達式引擎可能會更容易解釋。 – PSGuy

+0

@PSGuy酷 - 謝謝 – 0m3r