[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] ed with perl-compatible regular expressions
From: |
Martin Guy |
Subject: |
Re: [PATCH] ed with perl-compatible regular expressions |
Date: |
Thu, 22 Jul 2021 09:58:21 +0200 |
On 22/07/2021, Shawn Wagner <shawnw.mobile@gmail.com> wrote:
> The attached patch (Made against 1.18-pre2) adds a -P option to use
> PCRE2 regular expressions. Passing --disable-pcre2 to the configure
> script will leave this feature out. There's also a --utf8 option that
> turns on PCRE2's advanced Unicode matching.
Hmm. Interesting.
Currently ed already seems UTF8-aware. For example:
a
àèìòù
.
s/[à]/a/
replaces the two-character sequence with a single 'a' if $LANG ends
in .UTF-8, while if LANG=C or is unset, it only replaces the first
byte of the pair. Maybe you could find where it detects this and use
the same logic instead of --utf8
Cheers
M