Skip to content

Commit

Permalink
compile the regex
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp committed Aug 24, 2019
1 parent 9a0257e commit 1213d13
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Serilog.Sinks.File/Sinks/File/PathRoller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ public PathRoller(string path, RollingInterval interval)
"(?<" + PeriodMatchGroup + ">\\d{" + _periodFormat.Length + "})" +
"(?<" + SequenceNumberMatchGroup + ">_[0-9]{3,}){0,1}" +
Regex.Escape(_filenameSuffix) +
"$");
"$",
RegexOptions.Compiled);

DirectorySearchPattern = $"{_filenamePrefix}*{_filenameSuffix}";
}
Expand Down

0 comments on commit 1213d13

Please sign in to comment.