Instructs the System.Text.RegularExpressions source generator to generate an implementation of the specified regular expression.
public ref class GeneratedRegexAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Method | System.AttributeTargets.Property, AllowMultiple=false, Inherited=false)]
public sealed class GeneratedRegexAttribute : Attribute
[System.AttributeUsage(System.AttributeTargets.Method, AllowMultiple=false, Inherited=false)]
public sealed class GeneratedRegexAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Method | System.AttributeTargets.Property, AllowMultiple=false, Inherited=false)>]
type GeneratedRegexAttribute = class
inherit Attribute
[<System.AttributeUsage(System.AttributeTargets.Method, AllowMultiple=false, Inherited=false)>]
type GeneratedRegexAttribute = class
inherit Attribute
Public NotInheritable Class GeneratedRegexAttribute
Inherits Attribute
The generator associated with this attribute only supports C#. It only supplies an implementation when applied to partial, parameterless, non-generic methods that are typed to return Regex.
When the Regex supports case-insensitive matches (either by passing IgnoreCase or using the inline `(?i)` switch in the pattern) the regex engines will use an internal casing table to transform the passed in pattern into an equivalent case-sensitive one. For example, given the pattern `abc`, the engines will transform it to the equivalent pattern `[Aa][Bb][Cc]`. The equivalences found in this internal casing table can change over time, for example in the case new characters are added to a new version of Unicode. When using the source generator, this transformation happens at compile time, which means the casing table used to find the equivalences will depend on the target framework at compile time. This differs from the rest of the Regex engines, which perform this transformation at run time, meaning they will always use casing table for the current runtime.
Constructors GeneratedRegexAttribute(String, RegexOptions, Int32, String)Initializes a new instance of GeneratedRegexAttribute with the specified pattern, options, time-out value, and culture.
GeneratedRegexAttribute(String, RegexOptions, Int32)Initializes a new instance of GeneratedRegexAttribute with the specified pattern, options, and time-out value.
GeneratedRegexAttribute(String, RegexOptions, String)Initializes a new instance of GeneratedRegexAttribute with the specified pattern and options.
GeneratedRegexAttribute(String, RegexOptions)Initializes a new instance of GeneratedRegexAttribute with the specified pattern and options.
GeneratedRegexAttribute(String)Initializes a new instance of GeneratedRegexAttribute with the specified pattern.
Properties CultureNameGets the name of the culture to be used for case sensitive comparisons.
MatchTimeoutMillisecondsGets a time-out interval (milliseconds), or Infinite to indicate that the method should not time out.
OptionsGets a bitwise combination of the enumeration values that modify the regular expression.
PatternGets the regular expression pattern to match.
TypeIdWhen implemented in a derived class, gets a unique identifier for this Attribute.
(Inherited from Attribute) MethodsCollaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide. In this articleWas this page helpful?
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4