in reply to Replace strings with "("

Maybe you could try s/(test\(\W)(test)/$1GC_$2/ as the quotation mark might not be the same in the regexp and in the string.