Suppose I have this piece of text:
Saturday and Sunday and Monday and Tuesday and Wednesday and Thursday and Friday are days of the week.
I want all but the last and to be replaced with a comma:
Saturday, Sunday, Monday, Tuesday, Wednesday, Thursday and Friday are days of the week.
Is there an easy way to do that in regex? As far as I know, the replace method in regex replaces the strings all the way through.