The bug is about {n,m} regular expression in ed.
ed does not recognize 0 in {n,m} which it should.
This can be demonstrated in the following session: {0,3} fails but {1,3} 
succeeds.


$ uname -a
Linux myhost 5.0.0-13-generic #14-Ubuntu SMP Mon Apr 15 14:59:14 UTC 2019 
x86_64 x86_64 x86_64 GNU/Linux

$ ed -V
GNU ed 1.15
Copyright (C) 1994 Andrew L. Moore.
Copyright (C) 2019 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.

$ cat ttt
asef
aseg
esfg
aes
sefg

$ echo -e 'g/e\{0,3\}/s//d/g\nwq\n'  | ed -s ttt
$ cat ttt
asef
aseg
esfg
aes
sefg

$ echo -e 'g/e\{1,3\}/s//d/g\nwq\n'  | ed -s ttt
$ cat ttt
asdf
asdg
dsfg
ads
sdfg

Thanks,
Mike

_______________________________________________
bug-ed mailing list
bug-ed@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-ed

Reply via email to