{"id":41455,"date":"2021-05-04T21:03:50","date_gmt":"2021-05-04T21:03:50","guid":{"rendered":"https:\/\/www.oracletutoring.ca\/blog\/?p=41455"},"modified":"2021-05-04T21:03:52","modified_gmt":"2021-05-04T21:03:52","slug":"liunix-grep-part-4-back-to-earth","status":"publish","type":"post","link":"https:\/\/www.oracletutoring.ca\/blog\/liunix-grep-part-4-back-to-earth\/","title":{"rendered":"(Li|U)nix: grep, part 4: back to Earth"},"content":{"rendered":"\n<h2>Self-tutoring about computer science: the tutor continues about grep.<\/h2>\n<p>\nI mention back in my <a href=\"https:\/\/www.oracletutoring.ca\/blog\/liunix-grep-part-2-a-bit-about-character-classes\/\">post from March 20, 2021<\/a> that on one system I use, grep handles the character classes \\d and \\w. Yet, one can&#8217;t count on all systems doing so.<\/p>\n<p>Today I was using one in which grep wouldn&#8217;t work with \\d or \\w, but insisted on the character classes [[:digit:]], [[:alpha:]], [[:alnum:]], and so on. These are obviously not so convenient as Perl character classes (such as \\d and \\w); furthermore, [[:digit:]] is probably less convenient than [0-9]. \\d and \\w are big advantages of Perl regular expressions, which grep, by itself, isn&#8217;t expected to support.<\/p>\n<p>I&#8217;ve read some people mention they use [:alpha:] and [:digit:] rather than the double-layer brackets. However, the double-layer brackets I find to be reliable, while [:digit:] or [:alpha:] only work sometimes. Such is my experience, anyway.<\/p>\n<p>I&#8217;ll be posting more about grep, I expect:)<\/p>\n<p>Source:<\/p>\n<p><a href=\"https:\/\/perldoc.perl.org\/perlre#Character-Classes-and-other-Special-Escapes\">perldoc.perl.org<\/a><\/p>\n<p><a href=\"https:\/\/www.cyberciti.biz\/faq\/grep-regular-expressions\/\">cyberciti.biz<\/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 computer science: the tutor continues about grep. I mention back in my post from March 20, 2021 that on one system I use, grep handles the character classes \\d and \\w. Yet, one can&#8217;t count on all systems &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"more-link\" href=\"https:\/\/www.oracletutoring.ca\/blog\/liunix-grep-part-4-back-to-earth\/\"> <span class=\"screen-reader-text\">(Li|U)nix: grep, part 4: back to Earth<\/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-41455","post","type-post","status-publish","format-standard","hentry","category-computer-science"],"_links":{"self":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/41455","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=41455"}],"version-history":[{"count":6,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/41455\/revisions"}],"predecessor-version":[{"id":41461,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/41455\/revisions\/41461"}],"wp:attachment":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/media?parent=41455"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/categories?post=41455"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/tags?post=41455"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}