afc_regexp_replace

Name

afc_regexp_replace  -- Replaces a string using RE patterns

Synopsis

int afc_regexp_replace ( RegExp * regexp, char * dest, char * src, char * str_re, char * replace, short replace_all );

Description

With this method you can replace a string or a part of it using Regular Expression as pattern matching. Rules are almost the same as the sed command or the vi editor. Only, it does not have sense use the "^" operator with the replace_all set to TRUE.

Inputs

regexp

Pointer to a valid afc_regexp class.

dest

Destination string where the result of substitution will be saved. This string MUST be an AFC afc_string_new.

src

Source string

str_re

afc_string_new defining the RE used as search pattern

replace

afc_string_new containing the replace mask

replace_all

Flag TRUE/FALSE. If TRUE the replacement will take place in all possible places of the string, if FALSE the replace will take place only once.

Result

should be AFC_ERR_NO_ERROR

See Also