Search and Replace Pattern (string) VI
- Updated2026-07-27
- 2 minute(s) read
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.

Inputs/Outputs
replace all? (F)
—
If replace all? is TRUE, the VI replaces all substrings in string that match regular expression.
string
—
string specifies the input string you want the function to search.
regular expression ("")
—
regular expression is the pattern for which you want to search in string.
replace string ("")
—
replace string replaces the substring in string that matches regular expression. The default is an empty string.
offset (0)
—
offset specifies number of characters into string at which the function starts searching for a match. offset must be numeric.
result string
—
result string contains the edited string with the replaced characters.
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.
replace all? (F)
—
string
—
offset (0)
—
result string
—
offset past match
—