{"id":41463,"date":"2021-05-05T22:11:42","date_gmt":"2021-05-05T22:11:42","guid":{"rendered":"https:\/\/www.oracletutoring.ca\/blog\/?p=41463"},"modified":"2021-05-05T22:11:44","modified_gmt":"2021-05-05T22:11:44","slug":"comp-sci-liunix-regular-expressions-part5-grep-p","status":"publish","type":"post","link":"https:\/\/www.oracletutoring.ca\/blog\/comp-sci-liunix-regular-expressions-part5-grep-p\/","title":{"rendered":"Comp Sci: (Li|U)nix: regular expressions part5: grep -P"},"content":{"rendered":"\n<h2>Self-tutoring about grep and regex: the tutor explores grep -P: P is for Perl.<\/h2>\n<p>When it comes to regular expressions, it&#8217;s hard to beat Perl. grep -P supports Perl regular expressions, but it&#8217;s noted as &#8220;experimental.&#8221;<\/p>\n<p>I tried it today with a file containing a postal code:<\/p>\n<p style=\"font-family:monospace; font-size:1.2rem\">grep -P -i &#8220;[a-z]\\d[a-z]\\d[a-z]\\d&#8221; testfile<\/p>\n<p>It found the postal code no problem.<\/p>\n<p>As I&#8217;ve mentioned: <em>not all systems are the same.<\/em> Therefore, that experiement may not bring the same success on a different one.<\/p> \n<p>Source:<\/p>\n<p><a href=\"https:\/\/linux.die.net\/man\/1\/grep\">linux.die.net<\/a><\/p>\nJack of <a href=\"https:\/\/www.oracletutoring.ca\">Oracle Tutoring by Jack and Diane,<\/a> Campbell River, BC.\n","protected":false},"excerpt":{"rendered":"<p>Self-tutoring about grep and regex: the tutor explores grep -P: P is for Perl. When it comes to regular expressions, it&#8217;s hard to beat Perl. grep -P supports Perl regular expressions, but it&#8217;s noted as &#8220;experimental.&#8221; I tried it today &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"more-link\" href=\"https:\/\/www.oracletutoring.ca\/blog\/comp-sci-liunix-regular-expressions-part5-grep-p\/\"> <span class=\"screen-reader-text\">Comp Sci: (Li|U)nix: regular expressions part5: grep -P<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[105],"tags":[],"class_list":["post-41463","post","type-post","status-publish","format-standard","hentry","category-computer-science"],"_links":{"self":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/41463","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/comments?post=41463"}],"version-history":[{"count":3,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/41463\/revisions"}],"predecessor-version":[{"id":41466,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/41463\/revisions\/41466"}],"wp:attachment":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/media?parent=41463"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/categories?post=41463"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/tags?post=41463"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}