I have a large array with string. Now, I need to use the string in the array to form patterns. However for the string with round brackets, the constructed patterns don\'t work.
You are replacing ( with \\\\(. \\\\( compiled in regex is \\(, which basicly means escape the \ and then (, not escape the (. What you are looking for is the following: