user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
* are Perl regexps well-known enough for command-line use?
@ 2020-12-14 20:39 Eric Wong
  2020-12-15 14:21 ` Konstantin Ryabitsev
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Wong @ 2020-12-14 20:39 UTC (permalink / raw)
  To: meta

I've been thinking a bit about UI/UX for local command-line
tooling, and one thing I've been pondering is exposing Perl5
regexps as a mechanism for filtering
mailboxes/newsgroups/URLs/pathnames, etc...

It ties the UI to Perl5, though PCRE can get pretty close...

NNTP has it's own "wildmat" format in RFC 3977 which we support
(though maybe not 100% completely :x).  It's pretty close to
Bourne shell globbing, I think.

Perl's built-in and stdlib glob operators only work on FS paths,
and (as usual) I'm trying to avoid dependencies or Inline::C for
ease-of-installation and disk/bandwidth considerations.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: are Perl regexps well-known enough for command-line use?
  2020-12-14 20:39 are Perl regexps well-known enough for command-line use? Eric Wong
@ 2020-12-15 14:21 ` Konstantin Ryabitsev
  2020-12-15 20:17   ` Eric Wong
  0 siblings, 1 reply; 3+ messages in thread
From: Konstantin Ryabitsev @ 2020-12-15 14:21 UTC (permalink / raw)
  To: Eric Wong; +Cc: meta

On Mon, Dec 14, 2020 at 08:39:38PM +0000, Eric Wong wrote:
> I've been thinking a bit about UI/UX for local command-line
> tooling, and one thing I've been pondering is exposing Perl5
> regexps as a mechanism for filtering
> mailboxes/newsgroups/URLs/pathnames, etc...

I think it's best to stick to the same regexp flavour as used by git for 
things like "git log -S", since people most likely to use this 
functionality are the same people likely to use git.

I believe it's POSIX, not PCRE -- but I don't know how reasonable it is 
to support POSIX regexps in Perl.

-K

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: are Perl regexps well-known enough for command-line use?
  2020-12-15 14:21 ` Konstantin Ryabitsev
@ 2020-12-15 20:17   ` Eric Wong
  0 siblings, 0 replies; 3+ messages in thread
From: Eric Wong @ 2020-12-15 20:17 UTC (permalink / raw)
  To: meta

Konstantin Ryabitsev <konstantin@linuxfoundation.org> wrote:
> On Mon, Dec 14, 2020 at 08:39:38PM +0000, Eric Wong wrote:
> > I've been thinking a bit about UI/UX for local command-line
> > tooling, and one thing I've been pondering is exposing Perl5
> > regexps as a mechanism for filtering
> > mailboxes/newsgroups/URLs/pathnames, etc...
> 
> I think it's best to stick to the same regexp flavour as used by git for 
> things like "git log -S", since people most likely to use this 
> functionality are the same people likely to use git.

That's my first choice, too

> I believe it's POSIX, not PCRE -- but I don't know how reasonable it is 
> to support POSIX regexps in Perl.

There's an re engine for POSIX regexps on CPAN, but it's not in
any distros.  A strong dependency on Inline::C would make it
harder to install.

All the stuff that's in Xapian can be filtered using the normal
search terms and wildcard support in native Xapian; which can
includes all of what's in the proposed ls-* commands.

I think that leaves pathnames and URLs (IMAP/NNTP)
for --exclude=PATH/FOLDERS and --include...
globs with '?' and '*' support is sufficient, there, I hope.
No need to introduce users to IMAP vs NNTP wildcard differences.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-12-15 20:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-14 20:39 are Perl regexps well-known enough for command-line use? Eric Wong
2020-12-15 14:21 ` Konstantin Ryabitsev
2020-12-15 20:17   ` Eric Wong

Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).