Name
RegExp.Execute Method
Syntax
RegExp.Execute(string)stringUse: Required
Data Type: String
The string to be searched.
Return Value
A Matches collection containing one or more Match objects.
Description
Performs a regular expression search against
string and returns the results in the
Matches collection.
Rules at a Glance
The method searches
stringusing the RegExp object’s Pattern property.The results are returned in the Matches collection, which is a collection of Match objects.
If the search finds no matches, the Matches collection is empty.
Programming Tips and Gotchas
Remember to use the
Setstatement to assign the Matches collection returned by the Execute method to an object variable.You can determine whether the Matches collection returned by the Execute method is empty by examining its Count property. It is empty if the value of Count is 0.
Example
See the example for the RegExp.Pattern Property.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access