Um, actually, Regex is quite versatile and capable of doing substitution all day long......
http://www.java2s.com/Code/Java/Regular-Expressions/QuickdemoofRegularExpressionssubstitution.htm
Regex is brittle, you have to get it right or the results get unpredictable.