{"id":6560,"date":"2006-03-31T12:30:30","date_gmt":"2006-03-31T20:30:30","guid":{"rendered":"http:\/\/www.transterrestrial.com\/wordpress\/?p=6560"},"modified":"2006-03-31T12:30:30","modified_gmt":"2006-03-31T20:30:30","slug":"regex-bleg","status":"publish","type":"post","link":"https:\/\/www.transterrestrial.com\/wordpress\/2006\/03\/31\/regex-bleg\/","title":{"rendered":"Regex Bleg"},"content":{"rendered":"<p>Can someone give me a regular expression for my blacklist that would disallow any four-consonant (lower case) string?  I&#8217;ve been getting a lot of spam lately like this one:<\/p>\n<blockquote><p>Name: Ryan<br \/>\nEmail Address: ron@fromru.com<\/p>\n<p>Comments:<\/p>\n<p>Well done!<br \/>\n[url=http:\/\/cowbtclt.com\/gcqj\/uqml.html]My homepage[\/url] | [url=http:\/\/vprqmclp.com\/rsyx\/vvwl.html]Cool site[\/url]<\/p><\/blockquote>\n<p>None of these seem to be real domains, so I don&#8217;t know what the point is, but they all seem to have at least four consonants in a row.  I figure that there are few real words like this, at least in English, so it would keep out the riff raff without impeding genuine commenters.<\/p>\n<p>[Update on Friday night]<\/p>\n<p>OK, as a commenter has pointed out, this would preclude some actual English word (like &#8220;strength&#8221;).  So let&#8217;s go for five consonants.  My goal is to err on the side of letting good posts through.<\/p>\n<p>[Update on Saturday night]<\/p>\n<p>It doesn&#8217;t catch them all, but I did come up with a good trap for them: q[^ua\\ \\.\\,]<\/p>\n<p>Anything with a &#8220;q&#8221; in it followed by anything other than a &#8220;u&#8221; or &#8220;a&#8221; (or a space, period or comma, so we can write &#8220;Iraq&#8221;) is blocked.  A lot of these things have &#8220;q&#8221;s inserted in them.<\/p>\n<p>[Another update, a few minutes later, after testing]<\/p>\n<p>I&#8217;m getting a lot of <a href=\"http:\/\/www.transterrestrial.com\/archives\/006773.html#006773\" target=\"_ \">false positives<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Can someone give me a regular expression for my blacklist that would disallow any four-consonant (lower case) string? I&#8217;ve been getting a lot of spam lately like this one: Name: Ryan Email Address: ron@fromru.com Comments: Well done! [url=http:\/\/cowbtclt.com\/gcqj\/uqml.html]My homepage[\/url] | [url=http:\/\/vprqmclp.com\/rsyx\/vvwl.html]Cool site[\/url] None of these seem to be real domains, so I don&#8217;t know what &hellip; <a href=\"https:\/\/www.transterrestrial.com\/wordpress\/2006\/03\/31\/regex-bleg\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Regex Bleg<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-6560","post","type-post","status-publish","format-standard","hentry","category-administrative"],"_links":{"self":[{"href":"https:\/\/www.transterrestrial.com\/wordpress\/wp-json\/wp\/v2\/posts\/6560","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.transterrestrial.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.transterrestrial.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.transterrestrial.com\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.transterrestrial.com\/wordpress\/wp-json\/wp\/v2\/comments?post=6560"}],"version-history":[{"count":0,"href":"https:\/\/www.transterrestrial.com\/wordpress\/wp-json\/wp\/v2\/posts\/6560\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.transterrestrial.com\/wordpress\/wp-json\/wp\/v2\/media?parent=6560"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.transterrestrial.com\/wordpress\/wp-json\/wp\/v2\/categories?post=6560"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.transterrestrial.com\/wordpress\/wp-json\/wp\/v2\/tags?post=6560"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}