String: Regex

This page documents the development version of Graphite at dev.graphite.art, which may differ from the current release.

Nodes in this category perform string operations involving regular expressions, such as pattern matching and replacement.

Nodes

NodeDetailsPossible Types
Regex Contains

Checks whether the string contains a match for the given regular expression pattern. Optionally restricts the match to only the start and/or end of the string.

String → Bool
String[] → Bool[]
Regex Find All

Finds all non-overlapping matches of a regular expression pattern in the string, returning a list of the matched substrings.

Each item carries start and end byte-offset attributes pointing into the original string.

String → String[]
String[] → String[]
Regex Replace

Replaces matches of a regular expression pattern in the string. The replacement string can reference captures: $0 for the whole match and $1, $2, etc. for capture groups.

String → String
String[] → String[]
Regex Split

Splits a string into a list of substrings pulled from between separator characters as matched by a regular expression.

For example, splitting "Three, two, one... LIFTOFF" with pattern \W+ (non-word characters) produces ["Three", "two", "one", "LIFTOFF"].

String → String[]
String[] → String[]