Skip to content

New nodes: 'Regex Contains', 'Regex Replace', 'Regex Find', 'Regex Find All', and 'Regex Split'#4045

Merged
Keavon merged 2 commits intomasterfrom
regex-nodes
Apr 24, 2026
Merged

New nodes: 'Regex Contains', 'Regex Replace', 'Regex Find', 'Regex Find All', and 'Regex Split'#4045
Keavon merged 2 commits intomasterfrom
regex-nodes

Conversation

@Keavon
Copy link
Copy Markdown
Member

@Keavon Keavon commented Apr 24, 2026

Category - Text: Regex

  • Regex Contains: Checks if a string matches a regex pattern, optionally anchored to start/end.
  • Regex Replace: Replaces regex matches with a replacement string (supports capture group references $0, $1, etc.).
  • Regex Find: Finds the Nth match of a regex and returns it with its capture groups as a list.
  • Regex Find All: Finds all non-overlapping matches of a regex pattern, returning a list.
  • Regex Split: Splits a string on a regex separator pattern.

Broken out from #4010.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 8 files

Confidence score: 4/5

  • This PR looks safe to merge overall: both reported issues are mid-severity (5/10) and appear to be consistency/process concerns rather than clear runtime breakage.
  • The most user-impacting item is in node-graph/nodes/text/src/regex.rs, where regex_find has an empty node category; this can reduce discoverability by keeping it from appearing alongside other regex nodes.
  • The note in editor/src/messages/portfolio/document/node_graph/document_node_definitions.rs is a PR-title format enforcement issue (New node(s): ...), which is important for workflow consistency but is not likely to affect product behavior.
  • Pay close attention to node-graph/nodes/text/src/regex.rs and editor/src/messages/portfolio/document/node_graph/document_node_definitions.rs - node categorization consistency and required title-format compliance should be corrected.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="editor/src/messages/portfolio/document/node_graph/document_node_definitions.rs">

<violation number="1" location="editor/src/messages/portfolio/document/node_graph/document_node_definitions.rs:1493">
P2: Custom agent: **PR title enforcement**

PR title for a node-adding change does not use the required dedicated "New node(s): ..." format.</violation>
</file>

<file name="node-graph/nodes/text/src/regex.rs">

<violation number="1" location="node-graph/nodes/text/src/regex.rs:82">
P2: `regex_find` is registered with an empty node category, which can prevent it from appearing with the other regex nodes and makes it inconsistent with the rest of this feature.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread node-graph/nodes/text/src/regex.rs
@Keavon Keavon changed the title Add a family of 5 regex nodes for string processing New nodes: 'Regex Contains', 'Regex Replace', 'Regex Find', 'Regex Find All', and 'Regex Split' Apr 24, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new suite of regex-based nodes for the node graph system, including regex_contains, regex_replace, regex_find, regex_find_all, and regex_split, alongside utility traits for index manipulation. The review identified several high-severity type mismatch issues in the node definitions where f64 was incorrectly used instead of i64 for index inputs, as well as medium-severity concerns regarding safe integer handling and logging consistency in the new regex implementation.

Comment thread node-graph/nodes/graphic/src/graphic.rs
Comment thread node-graph/nodes/text/src/regex.rs
Comment thread node-graph/nodes/text/src/regex.rs
@Keavon Keavon merged commit c9c76df into master Apr 24, 2026
11 checks passed
@Keavon Keavon deleted the regex-nodes branch April 24, 2026 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant