regex implementation to replace group with its lowercase version

berek picture berek · Jan 9, 2009 · Viewed 44.3k times · Source

Is there any implementation of regex that allow to replace group in regex with lowercase version of it?

Answer

Kim picture Kim · May 15, 2009

If your regex version supports it, you can use \L, like so in a POSIX shell:

sed -r 's/(^.*)/\L\1/'