[Issue 10772] New: std.regex.splitter generates spurious empty elements with empty delimiter
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Aug 7 12:54:12 PDT 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10772
Summary: std.regex.splitter generates spurious empty elements
with empty delimiter
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: Phobos
AssignedTo: nobody at puremagic.com
ReportedBy: hsteoh at quickfur.ath.cx
--- Comment #0 from hsteoh at quickfur.ath.cx 2013-08-07 12:54:11 PDT ---
CODE:
--------
void main() {
import std.string, std.stdio, std.regex;
string s = "test";
writeln(std.regex.splitter(s.toUpper, regex("")));
}
--------
Output:
--------
["", "T", "E", "S", "T", ""]
--------
The first and last empty elements should not be included in the result. Cf.
Perl's split(//, "test").
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list