Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #104307

Re: fnmatch() vs. glob.glob()

From Ben Finney <ben+python@benfinney.id.au>
Newsgroups comp.lang.python
Subject Re: fnmatch() vs. glob.glob()
Date 2016-03-08 12:49 +1100
Message-ID <mailman.23.1457401807.15725.python-list@python.org> (permalink)
References (2 earlier) <14061576-1c44-49bb-a27b-279e43258f06@googlegroups.com> <mailman.15.1457398847.15725.python-list@python.org> <7475bb64-b2e7-45ff-a94e-dbc62f658fab@googlegroups.com> <mailman.17.1457399791.15725.python-list@python.org> <a0d8dba4-834b-4e28-95a6-43f8667fe2ce@googlegroups.com>

Show all headers | View raw


Jinghui Niu <niujinghui@gmail.com> writes:

> Let me try to describe the behaviours as much as I can here: It is a
> real-time search, updating the search result as you type; It is very
> smart, not limiting itself into the verbatim words, but extracting
> feature strings automatically, e.g., typing "fontz" will match not
> just "*fontz*", but also "font-size", "fontzipper", etc; It can be
> switched for certain type of files according specific rules, such as
> not including ".pyc" files.

None of that really depends on the difference between ‘glob’ versus
‘fnmatch’. Either of them could be at the bowels of an implementation of
the behaviour you describe.

> My gut feeling is that it is using Regex, but just wonder how I can
> fit Regex into either fnmatch() or glob() module.

You don't. Those two are *much* lower level than the behaviour you
describe, and don't have anything to say about that behaviour.

You will need all the extra framework implementing all the other stuff
you describe, before you make any decision between ‘fnmatch’ versus
‘glob’.

-- 
 \             “Skepticism is the highest duty and blind faith the one |
  `\               unpardonable sin.” —Thomas Henry Huxley, _Essays on |
_o__)                                   Controversial Questions_, 1889 |
Ben Finney

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

fnmatch() vs. glob.glob() Jinghui Niu <niujinghui@gmail.com> - 2016-03-07 12:17 -0800
  Re: fnmatch() vs. glob.glob() Ben Finney <ben+python@benfinney.id.au> - 2016-03-08 08:37 +1100
    Re: fnmatch() vs. glob.glob() Jinghui Niu <niujinghui@gmail.com> - 2016-03-07 16:53 -0800
      Re: fnmatch() vs. glob.glob() Ben Finney <ben+python@benfinney.id.au> - 2016-03-08 12:00 +1100
        Re: fnmatch() vs. glob.glob() Jinghui Niu <niujinghui@gmail.com> - 2016-03-07 17:04 -0800
          Re: fnmatch() vs. glob.glob() Ben Finney <ben+python@benfinney.id.au> - 2016-03-08 12:16 +1100
            Re: fnmatch() vs. glob.glob() Jinghui Niu <niujinghui@gmail.com> - 2016-03-07 17:37 -0800
              Re: fnmatch() vs. glob.glob() Ben Finney <ben+python@benfinney.id.au> - 2016-03-08 12:49 +1100
              Re: fnmatch() vs. glob.glob() Chris Angelico <rosuav@gmail.com> - 2016-03-08 12:56 +1100
              Re: fnmatch() vs. glob.glob() MRAB <python@mrabarnett.plus.com> - 2016-03-08 02:35 +0000
          Re: fnmatch() vs. glob.glob() Steven D'Aprano <steve@pearwood.info> - 2016-03-08 13:19 +1100

csiph-web