![]() I was party to breaking this in 7bd1e61 inĢ007. but an IRC bot running 5.20.0 produces the same results so I assume ("", "foo"), but because of the special case in split of not producingĮmpty leading fields for zero-width matches at the beginning, we just getĪpparently split thinks /\A/ is the same as /^/m, matching after everyĮmbedded newline in the input string. Match once (at offset 0), which (logically speaking) should turn "foo" into Therefore split /\A/ should return the input string as is. # in the subject line of all future correspondence about this issue.Įmpty leading fields are produced when there are positive-width matchesĪt the beginning of the string a zero-width match at the beginning of the # New Ticket Created by Please include the string: but an IRC bot running 5.20.0 produces the same results so I assume it's still present in 5.20.įrom 11 September 2014 14:28, wrote: This is perl 5, version 12, subversion 4 (v5.12.4) built for x86_64-linux $ perl -wE 'say "" for split /\A/, "foo\nbar\nbaz"'Īpparently split thinks /\A/ is the same as /^/m, matching after every embedded newline in the input string. \A can only match once (at offset 0), which (logically speaking) should turn "foo" into ("", "foo"), but because of the special case in split of not producing empty leading fields for zero-width matches at the beginning, we just get "foo" again. \A "\A" only matches at the beginning of the string.Įmpty leading fields are produced when there are positive-width matches at the beginning of the string a zero-width match at the beginning of the string does not produce an empty field.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |