Compartir a través de


ArraySettingItemPropertyRule.EnvironmentVariableMatches Method

Definition

Creates a ArraySettingItemPropertyRule that is satisfied when an environment variable matches the provided regular expression.

public static Microsoft.VisualStudio.Extensibility.Settings.ArraySettingItemPropertyRule EnvironmentVariableMatches (string environmentVariableName, string regex);
static member EnvironmentVariableMatches : string * string -> Microsoft.VisualStudio.Extensibility.Settings.ArraySettingItemPropertyRule
Public Shared Function EnvironmentVariableMatches (environmentVariableName As String, regex As String) As ArraySettingItemPropertyRule

Parameters

environmentVariableName
String

The name of the environment variable.

regex
String

The regular expression to match to satisfy this rule.

Returns

A SettingRule instance.

Remarks

An undefined environment variable will be considered to have an empty string value.

The rule evaluates to true if environmentVariableName 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.

Applies to