javascript Reg Exp to match specific domain name

前端 未结 6 2121
小鲜肉
小鲜肉 2021-01-12 09:34

I have been trying to make a Reg Exp to match the URL with specific domain name.

So if i want to check if this url is from example.com what reg exp should be the bes

6条回答
  •  梦谈多话
    2021-01-12 10:10

    As you you pointed you only need example.com (write domain then escaped period then com), so use it in regex.

    Example

    UPDATED

    See the answer below

提交回复
热议问题