Remove preg_replace to hopefully fix segfault on long inputs, fixes #376