In a file test.txt I have the following text line
COPYRIGHT (c) 2020 alex4200
in which I want to use sed to find that line and to replace the year 2020 by the year 2021. I have tried the following expression:
sed -i -E "s/COPYRIGHT .*(\d\{4\}) alex4200/2021/" test.txt
but it did not change the text in the file test.txt. What am I missing?