ExtractRegularExpression Class
Extracts text from the response that matches the regular expression pattern.
Inheritance Hierarchy
Object
Microsoft.VisualStudio.TestTools.WebTesting.ExtractionRule
Microsoft.VisualStudio.TestTools.WebTesting.Rules.ExtractRegularExpression
Namespace: Microsoft.VisualStudio.TestTools.WebTesting.Rules
Assembly: Microsoft.VisualStudio.QualityTools.WebTestFramework (in Microsoft.VisualStudio.QualityTools.WebTestFramework.dll)
Syntax
'Declaration
Public Class ExtractRegularExpression _
Inherits ExtractionRule
public class ExtractRegularExpression : ExtractionRule
public ref class ExtractRegularExpression : public ExtractionRule
type ExtractRegularExpression =
class
inherit ExtractionRule
end
public class ExtractRegularExpression extends ExtractionRule
The ExtractRegularExpression type exposes the following members.
Constructors
Name | Description | |
---|---|---|
ExtractRegularExpression | Initializes a new instance of the ExtractRegularExpression class. |
Top
Properties
Name | Description | |
---|---|---|
ContextParameterName | Gets or sets the context name of the extracted property. (Inherited from ExtractionRule.) | |
HtmlDecode | Gets or sets a value that indicates whether the extracted value should be HTML decoded before the value is placed in the Web performance test context. | |
IgnoreCase | Gets or sets a value that indicates whether matching is case-sensitive. | |
Index | Gets or sets a value that represents an index value of an occurrence of a string that is located in the HtmlDocument. | |
RegularExpression | Gets or sets a regular expression which defines the string to extract. | |
Required | Gets or sets a value that indicates whether the extraction fails if the text represented by RegularExpression does not exist in the HtmlDocument. | |
RuleDescription | Obsolete. This method is no longer used. Use the DisplayNameAttribute on the class to set a description for this rule. (Inherited from ExtractionRule.) | |
RuleName | Obsolete. This method is no longer used. Use the DisplayNameAttribute on the class to set a display name for this rule. (Inherited from ExtractionRule.) |
Top
Methods
Name | Description | |
---|---|---|
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Extract | Finds the text represented by the regular expression in the response and adds the value to the WebTestContext. (Overrides ExtractionRule.Extract(Object, ExtractionEventArgs).) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Top
Remarks
This extraction rule provides great flexibility for searching text responses for an occurrence of a string.
For more information about regular expression characters, see Character Classes in Regular Expressions.
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
See Also
Reference
Microsoft.VisualStudio.TestTools.WebTesting.Rules Namespace
Other Resources
How to: Create a Custom Extraction Rule for a Web Performance Test
How to: Add an Extraction Rule to a Web Performance Test