ReplaceString (Regex property)

From m204wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

String regular expression (Regex class)


This method returns the replacement string value specified in the Regex constructor call.

Syntax

%string = regex:ReplaceString

Syntax terms

%stringThe replacement string value specified in the Regex constructor call.
regex The Regex object.

Usage notes

  • If the regular expresion specified in the constructor call was Unicode, this method causes request cancellation. To test if a Regex object was created with a Unicode regular expression check the IsUnicode property.
  • If no replacement string value was specified in the constructor call, a zero-length string is returned.

Examples

The following example:

b %regex is object regex %regex = new("([a-z]{3,})(\d{3,})", replace="$2$1") print %regex:replaceString end

displays:

$2$1

See also