echo ddayaynightday | sed \'s/day//g\'
It ends up daynight
daynight
Is there anyway to make it substitute until no more match ?
Ok, here they're: while and strlen in bash. Using them one may implement my idea:
Repeat until its length will stop changing.
There's neither way to set flag nor way to write such regex, to "substitute until no more match".