Share via


RegexCollection Interface

Represents a collection of regular expressions to be recognized by a smart tag in an Office solution.

Namespace:  Microsoft.Office.Tools
Assembly:  Microsoft.Office.Tools.Common (in Microsoft.Office.Tools.Common.dll)

Syntax

'Declaration
<GuidAttribute("cfab1305-802f-4c99-8aa2-f68281840d39")> _
Public Interface RegexCollection _
    Inherits IList, ICollection, IEnumerable
[GuidAttribute("cfab1305-802f-4c99-8aa2-f68281840d39")]
public interface RegexCollection : IList, 
    ICollection, IEnumerable

The RegexCollection type exposes the following members.

Properties

  Name Description
Public property Count Gets the number of elements contained in the ICollection. (Inherited from ICollection.)
Public property IsFixedSize Gets a value indicating whether the IList has a fixed size. (Inherited from IList.)
Public property IsReadOnly Gets a value indicating whether the IList is read-only. (Inherited from IList.)
Public property IsSynchronized Gets a value indicating whether access to the ICollection is synchronized (thread safe). (Inherited from ICollection.)
Public property Item Gets or sets the regular expression at the specified index.
Public property SyncRoot Gets an object that can be used to synchronize access to the ICollection. (Inherited from ICollection.)

Top

Methods

  Name Description
Public method Add(Object) Adds an item to the IList. (Inherited from IList.)
Public method Add(Regex) Adds a regular expression to the end of the RegexCollection.
Public method AddRange Adds an array of regular expressions to the end of RegexCollection.
Public method Clear Removes all items from the IList. (Inherited from IList.)
Public method Contains(Object) Determines whether the IList contains a specific value. (Inherited from IList.)
Public method Contains(Regex) Determines whether the RegexCollection contains a specific regular expression.
Public method CopyTo(Array, Int32) Copies the elements of the ICollection to an Array, starting at a particular Array index. (Inherited from ICollection.)
Public method CopyTo(array<Regex[], Int32) Copies the entire RegexCollection to a compatible one-dimensional array, starting at the specified index of the target array.
Public method GetEnumerator Returns an enumerator that iterates through a collection. (Inherited from IEnumerable.)
Public method IndexOf(Object) Determines the index of a specific item in the IList. (Inherited from IList.)
Public method IndexOf(Regex) Searches for the specified regular expression and returns the zero-based index of the first occurrence within the entire RegexCollection.
Public method Insert(Int32, Object) Inserts an item to the IList at the specified index. (Inherited from IList.)
Public method Insert(Int32, Regex) Inserts an element into the RegexCollection at the specified index.
Public method Remove(Object) Removes the first occurrence of a specific object from the IList. (Inherited from IList.)
Public method Remove(Regex) Removes the first occurrence of a specific regular expression from the RegexCollection.
Public method RemoveAt Removes the IList item at the specified index. (Inherited from IList.)

Top

Remarks

When you create a Microsoft.Office.Tools.Excel.SmartTag or Microsoft.Office.Tools.Word.SmartTag object to create a smart tag, you can use the Expressions property to add a regular expression to be recognized by the smart tag. The Expressions property has the type RegexCollection.

For more information about smart tags in Office solutions, see Smart Tags Overview.

See Also

Reference

Microsoft.Office.Tools Namespace

Other Resources

Smart Tags Overview