regex implementation to replace group with its lowercase version March 22, 2023 by Tarik If your regex version supports it, you can use \L, like so in a POSIX shell: sed -r 's/(^.*)/\L\1/'