Re: regexp: how to find square-bracket (literal)? ~s "\[foo\]" doesn't work.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jul 27, 2005 at 03:45:29PM -0400, David Combs wrote:
> Any idea how to find a literal square-bracket?

The subject line makes it look like you're trying to do a match using
mutt's syntax.  Trn does a subject search using '/':

    /\[foo]

I assume that that should select some articles with "[foo]" in the
subject (the code in search.c is certainly written that way).

> PS: question: what (open-source?) software does
>      trn use for its regexp-stuff?

It's some really old regex routines originally written by James Gosling
(and rewritten by Larry Wall).  The routine follows the sed style of
active meta characters (e.g. more chars are normal and need to be
escaped to become active than in the grep style).

..wayne..


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO September
19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf

[Index of Archives]     [Photo]     [Yosemite]     [Epson Inkjet]     [Mhonarc]     [Nntpcache]

  Powered by Linux