Partager via


Regular Expressions Foundation Class

Regular expressions are a concise and flexible notation for finding and replacing patterns of text. The Regular Expressions class gives you access to routines for using regular expressions in your applications.

Category

System Utilities

Default Catalog

Visual FoxPro Catalog\Foundation Classes\Utilities

Class

_regexp

Base Class

Custom

Class Library

_regexp.vcx

Parent Class

_custom

Sample

...\Samples\Solution\Ffc\Regexp.scx

Remarks

For information about the sample, see Search Text Using Regular Expressions Sample. For general details about regular expressions, you can refer to MSDN.

To use the Regular Expressions Foundation Class, drop the class on a project or form, or from the Component Gallery Item shortcut menu, select Add to Project or Add to Form. When you add the class to a form, Visual FoxPro places the class icon on the form. You can specify the appropriate property values and provide any necessary input and output objects. When you drop the class on a project, you can choose between adding the class or creating a subclass.

Properties, Events, Methods

Description

Matches array

Specifies the array containing the results of the string test.

Default: .F.

Pattern property

Contains the pattern (regular expression).

Default: *

Clear method

Clears all values.

Syntax: Clear( )

Return: none

Arguments:

Execute method

Tests the pattern against the string.

Syntax: Execute(tcStr, tlCaseMatters)

Return: number of matches

Arguments:

tcStr specifies string to search.tlCaseMatters specifies whether to ignore case.

See Also

Concepts

Guidelines for Using Visual FoxPro Foundation Classes

Reference

Visual FoxPro Foundation Classes A-Z

Other Resources

Foundation Class Samples