Applies to TestComplete 14.30, last modified on November 21, 2019


The RegExpr object allows you to use regular expressions in DelphiScript. This allows you to perform search and replace operations over the text fragments that match the specified regular expression pattern. Also, you can use regular expressions to validate user input data.

Please read the Regular Expressions Syntax topic to learn how to compose regular expressions.

The HISUtils object is available only if the HISUtils plugin (<TestComplete>\Bin\Extensions\tcHISUtils.pls) is installed. For information on how to install plugins in TestComplete, see Installing Extensions.



The following code obtains the text that matches a regular expression and posts the text to the test log.


procedure Sample;
  MyRegExpr : OleVariant;
  MyRegExpr := HISUtils.RegExpr;
  MyRegExpr.InputString := 'Please e-mail us at or';
  MyRegExpr.Expression := '[\w-]+(\.[\w-]+)*@([\w-]+\.)+[a-zA-Z]{2,7}';
  // Posts the first matching segment of the text to the test log

See Also

HISUtils Object
Installing Extensions
Using Regular Expressions in Scripts
Regular Expressions Syntax

Highlight search results