API ReferenceGE Extensionsflowgraphnodesstring
Match String (Flowgraph Node)
- **Node Name:** `Match String`
Overview
- Node Name:
Match String - Category:
simple - File:
extensions/flowgraph/nodes/string/match.lua
Matches a string against a Lua pattern and outputs the first match.
Pin Schema
Input Pins
| Pin | Type | Description |
|---|---|---|
value | string | The string to test against the pattern |
Output Pins
| Pin | Type | Description |
|---|---|---|
value | string | The result of the pattern match |
Data Properties
| Property | Type | Default | Description |
|---|---|---|---|
pattern | string | "%d" | Lua pattern to match against |
Behavior
init()- Sets default pattern to"%d".work()- Callsstring.match(input, pattern)and outputs the result.drawMiddle()- Displays the current pattern in the node body.
How It Works
- Set the
patterndata property to a Lua pattern string. - Connect an input string to the
valuepin. - The output
valuepin receives the first match fromstring.match.
-- Example: pattern = "%d+"
-- Input: "Score: 42 points"
-- Output: "42"
-- Example: pattern = "(%a+)"
-- Input: "hello world"
-- Output: "hello"Notes
- Uses Lua patterns (not regex). See Lua 5.1 pattern reference for syntax.
- Returns only the first match. For multiple captures, consider custom Lua.
Key Dependencies
- Lua built-in
string.match
See Also
- Format String (Flowgraph Node) - Related reference
- Concat (Flowgraph Node) - Related reference
- SubString (Flowgraph Node) - Related reference
- FlowGraph Guide - Guide