Regex_replace

miscellaneous-functions regex_replace

syntax

  • regex_replace(source, syntax, newvalues, optionalflag)

definition

regex_replace(source, syntax, newvalues, optionalflag) results in a string data-item in which the substrings of the source argument that meet the syntax argument are replaced by the newvalues argument.

A fourth optional argument optionalflag can be configured to control how the source string is matched against the syntax expressed by the syntax argument.

description

regex_match uses the boost 1.51 regex_match function. Click here for valid regex syntax rules and semantics.

The fourth, optionalflag argument is optional. More information on this argument can be found here.

In the GeoDMS this argument is passed as a uint32 parameter, see the enumeration of regex-flags.

applies to

  • data items source, syntax and newvalues with string value type
  • parameter optionalflag with uint32 value-type

since version

7.011

example

parameter<string> Text := dquote('Corop') + ';' + dquote('CoropLabel')";

// the following regex_replace function replaces double quoted headers
// by the newvalue: 'NewLabel'

parameter<bool> NewLabels := regex_replace(Text, '\"[^\"]*+\"',quote('NewLabel'));

result = ‘NewLabel’;’NewLabel

see also