Nautilus pattern matching.

Micah J. Cowan micah at cowan.name
Sat Jul 8 18:05:00 BST 2006


On Sat, Jul 08, 2006 at 09:24:09PM +1000, James Doc Livingston wrote:
> On 7/8/06, Klaus Bitto <klaus.bitto at gmail.com> wrote:
> > For the Regex thing, there has to be two modesm one of which uses simple
> > pattern matching for non-geeks.
> 
> What exactly would "simple" be? I can think of several variants, and
> supporting more than two (simple and regexp) would be heading towards
> insane to use.
> 
> 1) Contains exactly what the user entered. So "foo bar" would match any
> file with "foo bar" in the name.
> 2) Contains the words the user entered. So "foo bar" would match any
> file with the words "foo" and "bar" in the name
> 3) Windows-style pattern matching.

4) Unix-style pattern matching, I'm guessing that's a superset of 3)
anyway.

> (2) is handy for searching in many things, such as music or email, but
> I'm not sure how much more useful than (1) it would be for searching
> filenames.

In (4) you could do *{foo,bar}*... but that's not exactly
"user-friendly". (Perhaps [3] is best... if anyone really wants to be
using the power of [4], they might as well be using regexes).

Yeah, I think (2) would be only very occaisionally handy: it might be
better for the user to familiarize themselves with basic regexes like
foo|bar.

As far as I can tell, ATM Nautilus only supports (3) via Cntl-S.

> On Sat, 2006-07-08 at 11:53 +0100, Aigars Mahinovs wrote:
> > That is another either another option or there must be a way to tell a
> > simple pattern matching and a regex apart just by what the user enters
> > into the box. The simplest way would be to require to include the
> > regex in <> for example.
> 
> Starting with forward-slash is probably better, because it is guaranteed
> not to be in any file name and isn't a special regexp character, so
> won't ever be in a valid filename regexp. It also happens to be the same
> character vi uses for a regexp search.

And Firefox. And (in programming) in Perl and Sed and Awk... "Power
users" would generally be used to typing this.

In fact, even better than "recognizing" the difference after typing
Cntl-S or whatever, it would be much more straightforward to "power"
users if they could just immediately type "/" followed by a regex. Then
you could differentiate: if they had typed "/" to get to search-mode,
it's regex-search-mode; otherwise, they typed Cntl-S and it's
pattern-search-mode.

-- 
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/



More information about the ubuntu-devel mailing list