Issue #5422 has been updated by Suraj Kurapati.


What if we pass a File::FNM_EXTGLOB flag to the File.fnmatch methods?

  File.fnmatch? '{.g,t}*', '.gem', File::FNM_EXTGLOB

The name "extglob" comes from the Bash/Zsh option for extended globbing.
----------------------------------------
Feature #5422: File.fnmatch != Dir.glob # {no,sets}
https://bugs.ruby-lang.org/issues/5422#change-24617

Author: Suraj Kurapati
Status: Open
Priority: Normal
Assignee: 
Category: core
Target version: 3.0


Hello,

The File.fnmatch methods do not support Dir.glob's set notation:

>> Dir.glob '{.g,t}*'
=> [".gem", "test"]
>> File.fnmatch? '{.g,t}*', 'test'
=> false
>> File.fnmatch? '{.g,t}*', '.gem'
=> false

Please add set notation to fnmatch() and make it equal to glob().

Thanks for your consideration.


-- 
http://bugs.ruby-lang.org/