Searches string for substrings that match regular expression and replaces those substrings with replace string. A regular expression requires a specific combination of characters for pattern matching. For more information about special characters in regular expressions, refer to the regular expression input description in the detailed help.


icon

Inputs/Outputs

  • cbool.png replace all? (F)

    If replace all? is TRUE, the VI replaces all substrings in string that match regular expression.

  • cstr.png string

    string specifies the input string you want the function to search.

  • cstr.png regular expression ("")

    regular expression is the pattern for which you want to search in string.

  • cstr.png replace string ("")

    replace string replaces the substring in string that matches regular expression. The default is an empty string.

  • ci32.png offset (0)

    offset specifies number of characters into string at which the function starts searching for a match. offset must be numeric.

  • istr.png result string

    result string contains the edited string with the replaced characters.

  • ii32.png offset past match

    offset past match is the index in string of the first character after the last match. If the VI does not find a match, offset past match is –1.

  • This VI is similar to the Match Pattern function.

    This VI can perform a case-insensitive search or search for more complex patterns than the Search and Replace String function.