{"id":16932,"date":"2012-11-22T11:19:27","date_gmt":"2012-11-22T09:19:27","guid":{"rendered":"https:\/\/mamchenkov.net\/wordpress\/?p=16932"},"modified":"2012-11-22T11:19:28","modified_gmt":"2012-11-22T09:19:28","slug":"my-favorite-regex-of-all-time","status":"publish","type":"post","link":"https:\/\/mamchenkov.net\/wordpress\/2012\/11\/22\/my-favorite-regex-of-all-time\/","title":{"rendered":"My favorite regex of all time"},"content":{"rendered":"<!-- google_ad_section_start -->\n<p><a href=\"http:\/\/www.catonmat.net\/blog\/my-favorite-regex\/\">My favorite regex of all time<\/a><\/p>\n<p>Make sure to read through comments. \u00a0Funny stuff, if you know even the basics of the regular expressions.<\/p>\n<!-- google_ad_section_end -->\n","protected":false},"excerpt":{"rendered":"<!-- google_ad_section_start -->\n<p>My favorite regex of all time Make sure to read through comments. \u00a0Funny stuff, if you know even the basics of the regular expressions.<\/p>\n<!-- google_ad_section_end -->\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"link","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_links_to":"","_links_to_target":""},"categories":[1,18,62],"tags":[2418,2290,1129],"keyring_services":[],"class_list":["post-16932","post","type-post","status-publish","format-link","hentry","category-general","category-programming","category-technology","tag-humor","tag-regular-expressions","tag-t-shirts","post_format-post-format-link"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":27707,"url":"https:\/\/mamchenkov.net\/wordpress\/2017\/06\/20\/regex101-online-regex-editor-and-debugger\/","url_meta":{"origin":16932,"position":0},"title":"Regex101 &#8211; online regex editor and debugger","author":"Leonid Mamchenkov","date":"June 20, 2017","format":false,"excerpt":"Regex101 is an online regular expression editor and debugger. \u00a0You can test your regular expressions against sample data, see if the expression worked, watch it matched, and so on. \u00a0Having an explanation for each part of the regular expression dynamically generated, and a quick reference nearby is super handy too.\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2017\/06\/regex101-500x250.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":26269,"url":"https:\/\/mamchenkov.net\/wordpress\/2016\/07\/21\/the-regex-that-killed-stackoverflow\/","url_meta":{"origin":16932,"position":1},"title":"The RegEx that killed StackOverflow","author":"Leonid Mamchenkov","date":"July 21, 2016","format":false,"excerpt":"Here's an outage postmortem from the recent StackOverflow downtime. \u00a0It just shows you how easy it is to break things, even they were built by some of the smartest people around. \u00a0Programming is touch and there is no way around it. Technical Details The regular expression was: ^[\\s\\u200c]+|[\\s\\u200c]+$ Which is\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":23988,"url":"https:\/\/mamchenkov.net\/wordpress\/2015\/04\/24\/mailrfc822address-regexp-based-address-validation\/","url_meta":{"origin":16932,"position":2},"title":"Mail::RFC822::Address: regexp-based address validation","author":"Leonid Mamchenkov","date":"April 24, 2015","format":"link","excerpt":"This is pure gold! \u00a0Check out the regular expression for an RFC822 email address validation. I'm not going to paste it here, being concerned that it will open the gates of hell or something, but here is a sneak preview of about the first third or so.","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"regex","src":"https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2015\/04\/regex-500x298.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":7951,"url":"https:\/\/mamchenkov.net\/wordpress\/2004\/09\/24\/working-with-hashes-in-perl\/","url_meta":{"origin":16932,"position":3},"title":"Working with hashes in Perl","author":"Leonid Mamchenkov","date":"September 24, 2004","format":false,"excerpt":"There are several very useful modules at CPAN to work with Perl hashes. Here is a short list to get you started. Tie::Hash::Approx - use key approximation to find values. Tie::AliasHash - use multiple keys for a single value. Tie::Hash::Expire - expire keys in hash after a predefined period of\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":7705,"url":"https:\/\/mamchenkov.net\/wordpress\/2004\/07\/22\/regular-expressions\/","url_meta":{"origin":16932,"position":4},"title":"Regular expressions","author":"Leonid Mamchenkov","date":"July 22, 2004","format":false,"excerpt":"Regular-Expressions.Info is a very good resource on ... eh, well ... regular expressions. There is a nicely done tutorial, lots of examples, a reference page, and page with a list of tools and libraries that support regular expressions.","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":9930,"url":"https:\/\/mamchenkov.net\/wordpress\/2006\/02\/22\/regexp-reminder\/","url_meta":{"origin":16932,"position":5},"title":"RegExp reminder","author":"Leonid Mamchenkov","date":"February 22, 2006","format":false,"excerpt":"I was just reminded about this small thing, which is so easy to forget - regular expressions that have markers of line start (^) and\/or line end($) are so much faster than those regexps that don't have these markers. The thing is that with line start\/end marker regexp engine needs\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_sharing_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts\/16932","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/comments?post=16932"}],"version-history":[{"count":0,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts\/16932\/revisions"}],"wp:attachment":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/media?parent=16932"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/categories?post=16932"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/tags?post=16932"},{"taxonomy":"keyring_services","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/keyring_services?post=16932"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}