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 正则匹配非站内链接
最新推荐文章于 2024-08-18 15:45:47 发布