Table Of Contents

Search and Replace String (G Dataflow)

Last Modified: January 9, 2017

Replaces one or all instances of a substring with another substring.

connector_pane_image
datatype_icon

multiline?

A Boolean value that determines whether to treat the text in input string as a multiple-line string. This affects how the ^ and $ characters handle matches.

True ^ matches the beginning of any line in input string. $ matches the end of any line in input string.
False ^ matches only the beginning of input string. $ matches only the end of input string.

Default: False

datatype_icon

ignore case?

A Boolean value that determines whether the string search is case sensitive.

True The search is not case sensitive
False The search is case sensitive.

Default: False

datatype_icon

replace all?

A Boolean value that determines whether the node replaces all occurrences of the search string or only the first occurrence.

True The search replaces all matches for the search string.
False The search replaces only the first occurrence of a match.

Default: False

datatype_icon

input string

The string that this node searches.

datatype_icon

search string

The string you want to replace if it exists in input string.

Implications of Empty String

If search string is an empty string and replace all? is FALSE, the node inserts replace string at the beginning of input string. If search string is an empty string and replace all? is TRUE, the node inserts replace string at the beginning of input string, in between each character, and at the end.

datatype_icon

replace string

The string used to replace search string in input string.

Default: Empty string

datatype_icon

offset

The number of bytes into the input string at which this node starts searching.

The offset of the first byte in the input string is 0. If offset is beyond the end of the input string, this node returns an empty string.

spd-note-note
Note  

Strings are encoded in UTF-8. In most cases, the number of bytes in a string is equivalent to the number of characters. However, for strings containing the characters U+0080 through U+7FFFFFFF, the number of bytes is greater than the number of characters.

datatype_icon

error in

Error conditions that occur before this node runs. The node responds to this input according to standard error behavior.

Default: No error

datatype_icon

result string

The input string with one or all occurrences of search string replaced with replace string.

If replace string is empty, result string contains input string with search string deleted.

datatype_icon

number of replacements

Number of times this node replaced search string.

datatype_icon

offset past replacement

The offset in result string of the byte immediately following where the last match and replacement occurred.

If the node does not find search string, this output is -1.

If replace all? is False, the next match, if any, is after this point.

spd-note-note
Note  

Strings are encoded in UTF-8. In most cases, the number of bytes in a string is equivalent to the number of characters. However, for strings containing the characters U+0080 through U+7FFFFFFF, the number of bytes is greater than the number of characters.

datatype_icon

error out

Error information. The node produces this output according to standard error behavior.

Where This Node Can Run:

Desktop OS: Windows

FPGA: All devices (only within an Optimized FPGA VI)


Recently Viewed Topics