ed uses Posix basic REs, and the use of \+ in basic REs to get the effect
of + in extended REs is a non-Posix extension.  See <
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html#tag_09_05_01>,
where there is no mention of \+ except its use in extended REs.  The same
is true of escaped ?, (, ), |, {.

The `info ed` command documents that exactly which regular expression
characters work depends on the regex package with which ed was built.

-- 
John Cowan          http://vrici.lojban.org/~cowan        co...@ccil.org
He made the Legislature meet at one-horse tank-towns out in the alfalfa
belt, so that hardly nobody could get there and most of the leaders
would stay home and let him go to work and do things as he pleased.
    --H.L. Mencken's translation of the Declaration of Independence


On Wed, Jan 2, 2019 at 3:52 PM Brian Zwahr <ech...@echosa.net> wrote:

> I'm having an issue where using \+ to search for multiple matches isn't
> working. Am I doing something wrong?
>
> I have GNU ed 1.14.2 installed on the latest macOS through Homebrew (
> https://brew.sh). Homebrew installed the executable as ged instead of ed,
> to not overtake the BSD ed that ships with macOS. I mention this so you
> understand why the command I'm running is ged instead of ed.
>
> I see that 1.15 is in pre-release, but I don't see this issue addressed in
> the changelogs I'm seeing in the archives of this list.
>
> Here are steps to reproduce:
>
> $ ged -v
> # Let's add a couple of lines.
> a
> foobar
> bazfoo
> .
> # Great! Now, let's search for "o".
> g/o/
> foobar
> bazfoo
> # Both lines match. Perfect. Now, let's search for multiple "o"s.
> g/o\+/
> # Not found? :-(
> q
> ?
> Warning: buffer modified
> q
>
> Proof of version:
>
> $ ged -V
> GNU ed 1.14.2
> Copyright (C) 1994 Andrew L. Moore.
> Copyright (C) 2017 Antonio Diaz Diaz.
> License GPLv3+: GNU GPL version 3 or later <
> http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.
>
> _______________________________________________
> bug-ed mailing list
> bug-ed@gnu.org
> https://lists.gnu.org/mailman/listinfo/bug-ed
>
_______________________________________________
bug-ed mailing list
bug-ed@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-ed

Reply via email to