public String process ( final String in ) { String retVal = in ; String old ; do { old = retVal ; retVal = from . matcher ( retVal ) . replaceAll ( to ) ; } while ( repeatUntilUnchanged && ! old . equals ( retVal ) ) ; return retVal ; }
Processes input replaces all as expected and returns the result .