【问题标题】:Regex match non-standard domains正则表达式匹配非标准域
【发布时间】:2023-03-25 16:08:01
【问题描述】:

我正在尝试正则表达式匹配非标准 TLD(以 .com、.net 或 .org 结尾的域)

我尝试了以下方法,但我做错了。

.*(?<!\.(?:com|net|org)\/)

http://www.spam-link.br/getmoneyhere.php

我的正则表达式可以匹配任何东西。任何想法我做错了什么?

https://regex101.com/r/HEbeWU/3

【问题讨论】:

    标签: regex pcre


    【解决方案1】:

    试试这个:

    http://[^:/]++(?<!\.(?:com|net|org))
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-01-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-06-21
      • 2018-07-17
      • 1970-01-01
      • 2020-03-28
      相关资源
      最近更新 更多