1、验证是否符合
const regExp = /^http(s?):\/\/badianboke.com$/
string.test(regExp) // true false
2、取出匹配结果
const string = https://badianboke.com/666
const regExp = /^http(s?):\/\/badianboke.com(\d{3})$/
const result = string.match(regExp)
// result[0] => https://badianboke.com/666
// result[1] => s
// result[2] => 666