{"id":5796,"date":"2016-12-16T13:14:00","date_gmt":"2016-12-16T18:14:00","guid":{"rendered":"http:\/\/irreal.org\/blog\/?p=5796"},"modified":"2016-12-16T13:14:34","modified_gmt":"2016-12-16T18:14:34","slug":"emacs-regular-expressions","status":"publish","type":"post","link":"https:\/\/irreal.org\/blog\/?p=5796","title":{"rendered":"Emacs Regular Expressions"},"content":{"rendered":"<p> <a href=\"http:\/\/kagan.mactane.org\/blog\/2011\/08\/16\/the-problem-with-jamie-zawinski-and-regular-expressions\/\">Jamie Zawinski<\/a> notwithstanding, I find regular expressions extraordinarily powerful and useful. Most of us in software engineering use them daily and almost all editors support them. One of the complaints I hear all the time is that Emacs regular expressions are not Perl compatible and therefore hard to learn and use or something. <\/p>\n<p> They <i>are<\/i> (slightly) different from Perl&rsquo;s implementation but guess what. Perl regular expressions are different from the original <code>grep<\/code> \/ <code>egrep<\/code> flavors as well and yet we all somehow learned to use Perl&rsquo;s version. Probably the difference that causes the most problems is parentheses. In most regular expression systems, parentheses are used for grouping and a literal parenthesis must be escaped as <code>\\(<\/code> or <code>\\)<\/code>. Emacs inverts this usage because parentheses are so common in Lisp. For me, the most annoying issue is having to use things like <code>[[:digit:]]<\/code> instead of <code>\\d<\/code>. <\/p>\n<p> In any event, Xah Lee has come to the rescue with his recently updated <a href=\"http:\/\/ergoemacs.org\/emacs\/emacs_regex.html\">Emacs Regex Tutorial<\/a>. He points out the differences and how to deal with Emacs specific issues such as case folding. It&rsquo;s a short tutorial and well worth taking the time to read. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Jamie Zawinski notwithstanding, I find regular expressions extraordinarily powerful and useful. Most of us in software engineering use them daily and almost all editors support them. One of the complaints I hear all the time is that Emacs regular expressions &hellip; <a href=\"https:\/\/irreal.org\/blog\/?p=5796\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[18],"class_list":["post-5796","post","type-post","status-publish","format-standard","hentry","category-general","tag-emacs"],"_links":{"self":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5796","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5796"}],"version-history":[{"count":1,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5796\/revisions"}],"predecessor-version":[{"id":5797,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5796\/revisions\/5797"}],"wp:attachment":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5796"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5796"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5796"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}