def has_href_not_XXX?(content)
content = content.dup
loop do
content.sub!(/href=(['"])([^'"]+)\1/, "")
if $2.blank?
return false
else
if (!$2[".XXX.com"])
return true
end
end
end
end
ruby 正则匹配非站内链接
最新推荐文章于 2025-08-07 10:51:56 发布