【发布时间】:2013-06-21 13:46:22
【问题描述】:
假设我有一个有效的域根列表,
example.com
test.com
还有一个变量
String url
如何使用正则表达式来验证我的变量 url 是否在列表中,包括子域?
例如,也许我的网址是"subdomain.case.example.com"
也就是说清楚:
我将如何使用正则表达式来验证我的网址是 *.example.com 或 *.test.com 或 example.com 或 test.com?
【问题讨论】:
标签: regex url language-agnostic