{"id":152,"date":"2020-01-29T16:20:44","date_gmt":"2020-01-29T16:20:44","guid":{"rendered":"http:\/\/eng.sbfactory.ru\/?p=152"},"modified":"2020-01-29T16:21:16","modified_gmt":"2020-01-29T16:21:16","slug":"how-to-use-regular-expressions-in-url-filters","status":"publish","type":"post","link":"https:\/\/eng.sbfactory.ru\/?p=152","title":{"rendered":"How to use regular expressions in URL filters"},"content":{"rendered":"<p><!--more--><img loading=\"lazy\" src=\"http:\/\/eng.sbfactory.ru\/wp-content\/uploads\/2020\/01\/2020-01-29_18-42-23.png\" alt=\"Content Downloader\" width=\"1071\" height=\"683\" class=\"alignnone size-full wp-image-153\" srcset=\"https:\/\/eng.sbfactory.ru\/wp-content\/uploads\/2020\/01\/2020-01-29_18-42-23.png 1071w, https:\/\/eng.sbfactory.ru\/wp-content\/uploads\/2020\/01\/2020-01-29_18-42-23-300x191.png 300w, https:\/\/eng.sbfactory.ru\/wp-content\/uploads\/2020\/01\/2020-01-29_18-42-23-1024x653.png 1024w, https:\/\/eng.sbfactory.ru\/wp-content\/uploads\/2020\/01\/2020-01-29_18-42-23-768x490.png 768w\" sizes=\"(max-width: 1071px) 100vw, 1071px\" \/><br \/>\n<BR><br \/>\n<img loading=\"lazy\" src=\"http:\/\/eng.sbfactory.ru\/wp-content\/uploads\/2020\/01\/2020-01-29_18-49-37.png\" alt=\"Content Downloader\" width=\"1105\" height=\"419\" class=\"alignnone size-full wp-image-154\" srcset=\"https:\/\/eng.sbfactory.ru\/wp-content\/uploads\/2020\/01\/2020-01-29_18-49-37.png 1105w, https:\/\/eng.sbfactory.ru\/wp-content\/uploads\/2020\/01\/2020-01-29_18-49-37-300x114.png 300w, https:\/\/eng.sbfactory.ru\/wp-content\/uploads\/2020\/01\/2020-01-29_18-49-37-1024x388.png 1024w, https:\/\/eng.sbfactory.ru\/wp-content\/uploads\/2020\/01\/2020-01-29_18-49-37-768x291.png 768w\" sizes=\"(max-width: 1105px) 100vw, 1105px\" \/><br \/>\n<BR><br \/>\n<strong>Regular expressions examples<\/strong><\/p>\n<pre lang=\"HTML\" line=\"1\">To get URLs which ends on a digit and \"\/\" char\r\n\r\n***.ru\/catalog\/computers_and_notebooks\/monitors\/1070937\/\r\n\r\nUse the regular expression\r\nre:[0-9]\/\\Z\r\n\r\nWhere\r\n[0-9] - denotes a digit\r\n\/ - denotes \"\/\" char\r\n\\Z - denotes end of the text\r\n\r\n\r\n\r\n\r\nTo get URLs wich contains 7 digits between slash\r\n\r\n***.ru\/catalog\/computers_and_notebooks\/monitors\/1070937\/\r\n\r\nUse the regular expression\r\nre:\/\\d{7}\/\\Z\r\n\r\nWhere\r\n\/ - denotes \"\/\" char\r\n\\d - denotes a digit\r\n{7} - means, that previous element (\\d) should repeat exactly 7 times\r\n\/ - denotes \"\/\" char\r\n\\Z - denotes end of the text\r\n\r\n\r\n\r\n\r\nTo get URLs wich contains from 7 to 10 digits between slash\r\n\r\n***.ru\/catalog\/computers_and_notebooks\/monitors\/1070937\/\r\n***.ru\/catalog\/computers_and_notebooks\/monitors\/10709378\/\r\n***.ru\/catalog\/computers_and_notebooks\/monitors\/1070937810\/\r\n\r\nUse the regular expression\r\nre:\/\\d{7,10}\/\\Z\r\n\r\nWhere\r\n\/ - denotes \"\/\" char\r\n\\d - denotes a digit\r\n{7,10} - means, that previous element (\\d) should repeat from 7 to 10 times\r\n\/ - denotes \"\/\" char\r\n\\Z - denotes end of the text<\/pre>\n<p><BR><br \/>\n<strong>See also:<\/strong><\/p>\n<p><a href=\"http:\/\/sbfactory.ru\/cd\/?p=2332\" rel=\"noopener noreferrer\" target=\"_blank\">&#8211; Regular expressions Syntax (not translated)<\/a><br \/>\n<a href=\"http:\/\/eng.sbfactory.ru\/?p=155\" rel=\"noopener noreferrer\" target=\"_blank\">&#8211; Regular expressions modifiers<\/a><br \/>\n<BR><br \/>\n<span id=\"post-ratings-152\" class=\"post-ratings\" data-nonce=\"1e961f37ea\"><img id=\"rating_152_1\" src=\"https:\/\/eng.sbfactory.ru\/wp-content\/plugins\/wp-postratings\/images\/stars\/rating_off.gif\" alt=\"\" title=\"\" onmouseover=\"current_rating(152, 1, '');\" onmouseout=\"ratings_off(0, 0, 0);\" onclick=\"rate_post();\" onkeypress=\"rate_post();\" style=\"cursor: pointer; border: 0px;\" \/><img id=\"rating_152_2\" src=\"https:\/\/eng.sbfactory.ru\/wp-content\/plugins\/wp-postratings\/images\/stars\/rating_off.gif\" alt=\"\" title=\"\" onmouseover=\"current_rating(152, 2, '');\" onmouseout=\"ratings_off(0, 0, 0);\" onclick=\"rate_post();\" onkeypress=\"rate_post();\" style=\"cursor: pointer; border: 0px;\" \/><img id=\"rating_152_3\" src=\"https:\/\/eng.sbfactory.ru\/wp-content\/plugins\/wp-postratings\/images\/stars\/rating_off.gif\" alt=\"\" title=\"\" onmouseover=\"current_rating(152, 3, '');\" onmouseout=\"ratings_off(0, 0, 0);\" onclick=\"rate_post();\" onkeypress=\"rate_post();\" style=\"cursor: pointer; border: 0px;\" \/><img id=\"rating_152_4\" src=\"https:\/\/eng.sbfactory.ru\/wp-content\/plugins\/wp-postratings\/images\/stars\/rating_off.gif\" alt=\"\" title=\"\" onmouseover=\"current_rating(152, 4, '');\" onmouseout=\"ratings_off(0, 0, 0);\" onclick=\"rate_post();\" onkeypress=\"rate_post();\" style=\"cursor: pointer; border: 0px;\" \/><img id=\"rating_152_5\" src=\"https:\/\/eng.sbfactory.ru\/wp-content\/plugins\/wp-postratings\/images\/stars\/rating_off.gif\" alt=\"\" title=\"\" onmouseover=\"current_rating(152, 5, '');\" onmouseout=\"ratings_off(0, 0, 0);\" onclick=\"rate_post();\" onkeypress=\"rate_post();\" style=\"cursor: pointer; border: 0px;\" \/> (No Ratings Yet)<br \/><span class=\"post-ratings-text\" id=\"ratings_152_text\"><\/span><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[19,21,9],"_links":{"self":[{"href":"https:\/\/eng.sbfactory.ru\/index.php?rest_route=\/wp\/v2\/posts\/152"}],"collection":[{"href":"https:\/\/eng.sbfactory.ru\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/eng.sbfactory.ru\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/eng.sbfactory.ru\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/eng.sbfactory.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=152"}],"version-history":[{"count":2,"href":"https:\/\/eng.sbfactory.ru\/index.php?rest_route=\/wp\/v2\/posts\/152\/revisions"}],"predecessor-version":[{"id":161,"href":"https:\/\/eng.sbfactory.ru\/index.php?rest_route=\/wp\/v2\/posts\/152\/revisions\/161"}],"wp:attachment":[{"href":"https:\/\/eng.sbfactory.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=152"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/eng.sbfactory.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=152"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/eng.sbfactory.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=152"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}