I am using egrep -R followed by a regular expression containing about 10 unions, so like:
.jpg | .png | .gif etc. This works well, now I would like
Honestly, much as I love sed for appropriate tasks, this is definitely a task for perl -- it's truly more powerful for this kind of one-liners, especially to "write it back to where it comes from" (perl's -i switch does it for you, and optionally also lets you keep the old version around e.g. with a .bak appended, just use -i.bak instead).
perl -i.bak -pe 's/\.jpg|\.png|\.gif/.jpg/
rather than intricate work in sed (if even possible there) or awk...