Multi-line regex improvements