groovy: how to replaceAll ‘)’ with ‘ ‘ December 20, 2023 by Tarik Same as in Java: def str2 = str1.replaceAll('\\)',' ') You have to escape the backslash (with another backslash).