> I need something like this, even though, I know this doesn't work:
> Dir.glob(/^f[0-9]{7}\.eps/)

You might not want to do this--see the other suggestions in the
thread--but something along these lines would make the above snippit
work as expected:

    class Dir
      class << self
        alias_method :__original_glob, :glob
      end

      def self.glob(query,*flags, &blk)
        return __original_glob(query,*flags,&blk) unless query.is_a? Regexp

        files = []

        Dir.new('.').each do |f|
          next unless query =~ f
          if blk.nil?
            files << f
          else
            blk.call(f)
          end
        end

        blk.nil?? files : nil
      end
    end

    # Testing it out:

    if $0 == __FILE__
      Dir.glob(/\A\..*/) do |f|
        puts "Dot-file: #{f}"
      end

      backups_regex  = Dir.glob(/~\z/)
      backups_string = Dir.glob('.?*~')

      p backups_regex
      p backups_string

      p backups_regex == backups_string  # => true
    end



-- 
Lou.