The function "regexp_replace" threw the wrong kind of exception if the replacement string was invalid.