Regex.CapNames 属性
定义
重要
此 API 不符合 CLS。
获取或设置将命名捕获组映射到其索引值的字典。Gets or sets a dictionary that maps named capturing groups to their index values.
protected:
property System::Collections::IDictionary ^ CapNames { System::Collections::IDictionary ^ get(); void set(System::Collections::IDictionary ^ value); };
[System.CLSCompliant(false)]
protected System.Collections.IDictionary? CapNames { get; set; }
protected System.Collections.IDictionary CapNames { get; set; }
[System.CLSCompliant(false)]
protected System.Collections.IDictionary CapNames { get; set; }
[<System.CLSCompliant(false)>]
member this.CapNames : System.Collections.IDictionary with get, set
member this.CapNames : System.Collections.IDictionary with get, set
Protected Property CapNames As IDictionary
属性值
将命名捕获组映射到其索引值的字典。A dictionary that maps named capturing groups to their index values.
- 属性
例外
向设置操作中的 CapNames 属性分配的值是 null。The value assigned to the CapNames property in a set operation is null.
注解
请注意,此属性是受保护的;它只能从类派生的类中访问 Regex 。Note that this property is protected; it can only be accessed from a class derived from the Regex class.
设置操作尝试将分配给该属性的值转换为 Hashtable 对象; 如果此转换失败,它将调用 Hashtable.Hashtable(IDictionary) 构造函数。A set operation attempts to convert the value assigned to the property to a Hashtable object; if this conversion fails, it calls the Hashtable.Hashtable(IDictionary) constructor.