Microsoft .NET 7 Preview 4 brings Regex improvements, cache metrics
[ad_1]
Microsoft’s most current preview of .Web 7, the forthcoming future model of its application enhancement platform, functions enhancements for working with normal expressions and caching.
Downloadable from the Microsoft .Internet web site, the fourth preview of .Internet 7 was posted May perhaps 10. The creation release is because of in November.
Microsoft .Internet Preview 4 adds remaining planned APIs that add support for span kinds to the Regex (normal expressions) library. The changes insert support for matching with ReadOnlySpan
inputs and overhaul the managing of RegexOptions.IgnoreCase
. The new span-based mostly APIs include things like:
Regex.IsMatch(ReadOnlySpan
, which suggests irrespective of whether the common expression finds a match in the enter span.input) Regex.Depend(ReadOnlySpan
, which queries an enter string for all occurrences of a normal expression and returns the number of matches.input) Regex.EnumerateMatches(ReadOnlySpan
, which lookups an input span for occurrences of a common expression and returns aenter) ValueMatchEnumerator
to lazily iterate about the matches.
In other Regex enhancements, Microsoft stated it has labored to make the code produced by the Regex source generator extra readable and much easier to debug, and to enable tasks with a number of supply-created common expression designs to share common code.
Preview 4 also introduces metrics assistance for IMemoryCache
. The most important APIs getting additional are MemoryCacheStatistics
, which retains cache strike, overlook, approximated size, and count for IMemoryCache
, and GetCurrentStatistics
, which returns an occasion of MemoryCacheStatistics
, or null when the TrackStatistics
flag is not enabled.
Also in Preview 4, Microsoft has finished annotating the Microsoft.Extensions.*
libraries for nullability, released an Exercise.Latest
adjust function to greatly enhance OpenTelemetry assistance for observability, and included the Procedure.Formats.Tar
assembly, which has cross-platform APIs for reading through, archiving, composing, and extracting Tar archives.
Microsoft .Net 7 Preview 1 was produced February 17, adopted by .Web 7 Preview 2 and .Web 7 Preview 3 on March 14 and April 13, respectively.
Copyright © 2022 IDG Communications, Inc.
[ad_2]
Source connection