There's nothing special about all those x's. g/x/s/y/z misbehaves, too. Related commands produce no such surprises: s/x/x prints once if successful s/x/x/ doesn't print s/x/x/p prints once if successful g/x/s/x/x/ doesn't print g/x/s/x/x/p prints substituted lines once
observed in versions 1.18 and 1.20.1 Doug McIlroy