escape text before applying regex