Thread overview
[Issue 2655] New: Allow alternation patterns in std.path.fnmatch
Feb 12, 2009
d-bugmail
Feb 12, 2009
d-bugmail
Feb 26, 2009
d-bugmail
February 12, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2655

           Summary: Allow alternation patterns in std.path.fnmatch
           Product: D
           Version: 1.037
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: bugzilla@digitalmars.com
        ReportedBy: wbaxter@gmail.com


It would be nice if fnmatch also supported the standard alternaltion syntax for wildcards, where "abc.{def,ghi}.jkl" matches either abc.def.jkl or "abc.gji.jkl".

Attached is a modified version of the function that does that.

Like the current implementation, the additions lack an escape syntax.  So it's not possible to match filename with a literal ',' or '{'.  (Just like the current function is unable to match a literal '[', '*' or '?' in a filename)


-- 

February 12, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2655





------- Comment #1 from wbaxter@gmail.com  2009-02-11 22:00 -------
Created an attachment (id=289)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=289&action=view)
fnmatch function enhanced with {,} patterns


-- 

February 26, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2655


bugzilla@digitalmars.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement




-- 

October 11, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2655


Andrei Alexandrescu <andrei@metalanguage.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |andrei@metalanguage.com
         AssignedTo|nobody@puremagic.com        |andrei@metalanguage.com


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
September 26, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=2655


Andrei Alexandrescu <andrei@metalanguage.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


--- Comment #2 from Andrei Alexandrescu <andrei@metalanguage.com> 2010-09-26 13:03:09 PDT ---
Included with credit the proposed function and unittest, with minor changes. Thanks!

http://www.dsource.org/projects/phobos/changeset/2058

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------