{"id":2418,"date":"2015-07-13T01:33:14","date_gmt":"2015-07-13T01:33:14","guid":{"rendered":"http:\/\/www.garysieling.com\/blog\/?p=2418"},"modified":"2015-07-13T01:33:14","modified_gmt":"2015-07-13T01:33:14","slug":"rethinkdb-filter-by-regular-expression-in-python","status":"publish","type":"post","link":"https:\/\/www.garysieling.com\/blog\/rethinkdb-filter-by-regular-expression-in-python\/","title":{"rendered":"RethinkDB filter by regular expression in python"},"content":{"rendered":"<p>Connect to the database:<\/p>\n<pre lang=\"python\">\nimport rethinkdb as r\nr.connect(\"127.0.0.1\", 28015).repl()\ndb = r.db(\"search\")\n<\/pre>\n<p>Filter using match:<\/p>\n<pre lang=\"python\">\ntable.filter(r.row[\"Url\"].match(\".*\\.pdf$\")).run()\n<\/pre>\n<p>Note that unlike SQL, the column headers are case sensitive. It appears that the regular expression must match the entire string.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Connect to the database: import rethinkdb as r r.connect(&#8220;127.0.0.1&#8221;, 28015).repl() db = r.db(&#8220;search&#8221;) Filter using match: table.filter(r.row[&#8220;Url&#8221;].match(&#8220;.*\\.pdf$&#8221;)).run() Note that unlike SQL, the column headers are case sensitive. It appears that the regular expression must match the entire string.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[4],"tags":[157,160,447,462,466],"aioseo_notices":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/2418"}],"collection":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/comments?post=2418"}],"version-history":[{"count":0,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/2418\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/media?parent=2418"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/categories?post=2418"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/tags?post=2418"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}