Marius, et al --

...and then Marius Gedminas said...
% On Sun, May 28, 2000 at 10:33:52PM -0400, David T-G wrote:
% > % Ah, I see.  It's ^~L "(alice|bob|carol)".  Precedence would be a good
% > % topic for the manual to go over quickly.
% 
% I think most Unix users (after struggling with bash, grep, etc.) develop
% a feeling on where and how and what to quote.

Probably right, but it wouldn't hurt to mention quotes as well -- or,
more likely, point folks off to an already-written regexp reference, like
the one that no doubt comes with the rx package.  I think the trick
above, though, was knowing *where* to put the quotes (leaving the ~L on
the outside).  And, of course, that sort of instruction isn't easily
condensed down to one paragraph in the manual.


% 
% > Whoops.  Pardon me for jumping in here, but shouldn't any parser be able
% > to detect a ( and put everything up until the matching ) in a separate
% > precedence?
% 
% It's not so simple as it sounds.  There are many quoting issues, like \(
% or [abc)def], that are not exactly matching parentheses.

Well, that's why I specifically said "matching" instead of "next" :-)
I remember having to write a regexp parser in school; we took each
advance, starting from the very basic with no nesting, one week (yes,
an entire week, and we needed it then) at a time -- and we never even
had to deal with classes like [abc].

But, hey, elegance is the art of making the not-simple look simple :-)


% 
% > into three ORs with an ( in one and a ) in another unless the code is
% > just plain broken -- but I can't read C enough to have any idea :-)  Note
% 
% The code is indeed broken.  Try, for example, this pattern:
% 
%  (~b "default[)]")
% 
% Mutt just scans for the first matching `)' ignoring any quotes, escapes,
% etc.

Yep.


% 
% OK, I've got to go.  Expect a patch in the evening.

Thanks a bunch, in advance!


% 
% Marius Gedminas
% -- 
% "Only wimps use tape backup: _real_ men just upload their important stuff
% on ftp, and let the rest of the world mirror it ;)"
% (Linus Torvalds, about his failing hard drive on linux.cs.helsinki.fi)


:-D
-- 
David T-G                       * It's easier to fight for one's principles
(play) [EMAIL PROTECTED]      * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.bigfoot.com/~davidtg/        Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
The "new millennium" starts at the beginning of 2001.  There was no year 0.
Note: If bigfoot.com gives you fits, try sector13.org in its place. *sigh*

PGP signature

Reply via email to