add and escape before $( in regex string so it is not interpreted as the