For .NET and Perl Regex: Instead of changing the Regex pattern, use the RegexOptions.Singleline (.NET) or "s" modifier (Perl). This enables "." to match newline.
RegexOptions.Singleline
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)