www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 15797] New: Add Option to Not Drop Matches in

https://issues.dlang.org/show_bug.cgi?id=15797

          Issue ID: 15797
           Summary: Add Option to Not Drop Matches in std.regex.splitter
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: jack jackstouffer.com

Either add the option, or give a different overload, to keep the matches when
using std.regex.splitter. For example, currently this happens:

enum split_decimal = ctRegex!(`([\.,])`);
string a = "2003.04.05";
splitter(a, split_decimal).equal(["2003", "04", "05"]);

I would like a way for this to happen:

splitter(a, split_decimal).equal(["2003", ".", "04", ".", "05"]);

--
Mar 14 2016