[Issue 1772] regexp.split behavior with captures needs to be documented

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jan 8 12:12:43 PST 2008


http://d.puremagic.com/issues/show_bug.cgi?id=1772


wbaxter at gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|regexp.split behaves        |regexp.split behavior with
                   |incorrectly using regexps   |captures needs to be
                   |with captures               |documented




------- Comment #2 from wbaxter at gmail.com  2008-01-08 14:12 -------
It seems I've been duped by writefln's output.
Further investigation shows that this:
   [410.90711,,,352.879]
is actually this:
   ["410.90711",  ",",  "352.879"]
and not a 4-element list with two empty strings as I thought.

I discovered this because I checked what python does with captures, and it is
this:
"""
If capturing parentheses are used in pattern, then the text of all groups in
the pattern are also returned as part of the resulting list. 
"""
So that made me think maybe D could be trying to do something similar.

Apparently it is.  So please just document it.


-- 



More information about the Digitalmars-d-bugs mailing list