【发布时间】:2011-05-04 21:00:18
【问题描述】:
我需要验证给定的 URL 是否与我的域掩码匹配。
示例:我只想允许满足此“伪掩码”的域:
https://*.domain.com
http://*.domain.com
所以下一个域名没问题:
http://my.domain.com/something/blah.html
https://www.domain.com/
http://domain.com/go/somewhere.html
https://very.weird.domain.com/index.jsp
但下一个域名不行:
https://domain.com.google.com/other.html
http://my.domainfake.com/haha.jsp
https://my.fakedomain.com/
【问题讨论】: