SettingRule.Matches(SimpleSetting<String>, String) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates a SettingRule that is satisfied when setting
's value
matches the provided regular expression.
public static Microsoft.VisualStudio.Extensibility.Settings.SettingRule Matches (Microsoft.VisualStudio.Extensibility.Settings.SimpleSetting<string> setting, string regex);
static member Matches : Microsoft.VisualStudio.Extensibility.Settings.SimpleSetting<string> * string -> Microsoft.VisualStudio.Extensibility.Settings.SettingRule
Public Shared Function Matches (setting As SimpleSetting(Of String), regex As String) As SettingRule
Parameters
- setting
- SimpleSetting<String>
The setting to evaluate.
- regex
- String
The regular expression to match to satisfy this rule.
Returns
A SettingRule instance.
Remarks
The rule evaluates to true if setting
's value contains a match for regex
, not only if it is an exact match; for an exact match, prepend ^ (beginning-of-string) and append $ (end-of-string) to the regular expression.