[Top][All Lists]

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

Re: Case-insensitive regular expressions

From: John Cowan
Subject: Re: Case-insensitive regular expressions
Date: Tue, 6 Jul 2021 19:11:53 -0400

On Tue, Jul 6, 2021 at 4:38 PM Shawn Wagner <shawnw.mobile@gmail.com> wrote:

1. A command line switch to match all REs that way. Easiest to add, but
> then what if you want some patterns to be sensitive and some not in the
> same session? It's just the reverse of the current form.

I think that would be Very Bad.

> 2. Adding an I flag to REs in address ranges, s, g, etc. (I instead of i to
> match GNU sed and for the same reason - to avoid ambiguity with the
> existing i command).

A possibility.

> 3. Take a page from GNU grep and add support for using PCRE2 regular
> expression engine via ed -P,

Certainly provides the most function, but may end up with an editor whose
regex package is larger than the rest of it!

4. Adopt the vim convention that \c anywhere in a regex makes it
case-insensitive.  Clean and fully isolated from the rest.

Implementation notes:  (a) You need to foldcase both the regex (before it
is compiled) and the text being matched; (b) Unicode case folding has a
bunch of special cases.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]