Replace text patterns using pattern-replace.