Updated replacement string to add right/left brackets