I would greatly appreciate it if somoene could help me out with something... I'm having trouble writing a loop in RoR that continues replacing based on a regular expression until there are no more matches left for the regular expression.

The part that confuses me the most is how to make a while loop continue until a regular expression is not returning values anymore... can anyone help me out with this?