This was probably originally added to make PNG transparency look like GIF transparency, which has just the one fully transparent color. I'd expect that it's expected behaviour from the users. I'd say keep it, but fix the regex as suggested by @olt.