in reply to regex to remove a word from string

By far the easiest way to handle a requirement like this is to split() the string into an array, then use “splicing” to remove the element of the array (reorder it, etc...), then join() the array back together to form a new string. This is a generalized solution to the problem that can easily survive the inevitable changes and refinements, without putting anyone through “regex hell.”

Replies are listed 'Best First'.
Re^2: regex to remove a word from string
by Anonymous Monk on Dec 04, 2014 at 18:01 UTC