{"id":1125,"date":"2011-09-29T15:03:00","date_gmt":"2011-09-29T15:03:00","guid":{"rendered":"http:\/\/www.b.shuttle.de\/hayek\/Hayek\/Jochen\/wp\/blog-en\/2011\/09\/29\/ruby-stringsplit-on-empty-pattern-or-string\/"},"modified":"2011-09-29T15:03:00","modified_gmt":"2011-09-29T15:03:00","slug":"ruby-stringsplit-on-empty-pattern-or-string","status":"publish","type":"post","link":"https:\/\/wp.jochen.hayek.name\/blog-en\/2011\/09\/29\/ruby-stringsplit-on-empty-pattern-or-string\/","title":{"rendered":"Ruby: String#split on empty pattern or string"},"content":{"rendered":"<p>\t\t\t\t<a href=\"http:\/\/ruby-doc.org\/core\/classes\/String.html#M001165\">RDoc Documentation [ruby-doc.org]<\/a><\/p>\n<p>&#8220;Funny&#8221; feature, actually only for wierdos:<\/p>\n<p><\/p>\n<div>\nIf\u00a0<em>pattern<\/em>\u00a0is a\u00a0<tt><a href=\"http:\/\/ruby-doc.org\/core\/classes\/Regexp.html\">Regexp<\/a><\/tt>,\u00a0<em>str<\/em>\u00a0is divided where the pattern matches. Whenever the pattern matches a zero-<a href=\"http:\/\/ruby-doc.org\/core\/classes\/String.html#M001131\">length<\/a>\u00a0string,\u00a0<em>str<\/em>\u00a0is\u00a0<a href=\"http:\/\/ruby-doc.org\/core\/classes\/String.html#M001165\">split<\/a>\u00a0into individual characters. If\u00a0<em>pattern<\/em>\u00a0contains groups, the respective matches will be returned in the array as well.<\/div>\n<div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>RDoc Documentation [ruby-doc.org] &#8220;Funny&#8221; feature, actually only for wierdos: If\u00a0pattern\u00a0is a\u00a0Regexp,\u00a0str\u00a0is divided where the pattern matches. Whenever the pattern matches a zero-length\u00a0string,\u00a0str\u00a0is\u00a0split\u00a0into individual characters. If\u00a0pattern\u00a0contains groups, the respective matches will be returned in the array as well.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_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},"_share_on_mastodon":"0"},"categories":[666],"tags":[],"class_list":["post-1125","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"share_on_mastodon":{"url":"","error":""},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/paO0kP-i9","jetpack_likes_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/posts\/1125","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/comments?post=1125"}],"version-history":[{"count":0,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/posts\/1125\/revisions"}],"wp:attachment":[{"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/media?parent=1125"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/categories?post=1125"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/tags?post=1125"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}