Skip to main content

Regex Extract

Runs on: Shared (backend or chatbox overlay).

Runs a regular expression against a string and outputs part of the match. Use it to pull the number out of !bet 500, strip a username from a message or isolate a URL. If nothing matches, the flow branch stops so empty results never reach downstream nodes.

Inputs​

NameTypeDescription
inputstringThe string to search.

Outputs​

NameTypeDescription
outputstringThe text from the chosen capture group, or the full match for group 0.

Configuration​

  • Pattern: The regular expression. Parentheses define capture groups. For example, !bet\s+(\d+) captures the number after !bet.
  • Flags: Regex flags. Use i for case-insensitive matching.
  • Group: Which group to return. 0 is the full match, 1 the first capture group, 2 the second, and so on.

Example​

A Chat Command trigger fires for !bet. Connect the message text to a Regex Extract node with the pattern !bet\s+(\d+) and Group 1 to get the number the viewer typed, such as "500". Feed it into a To Number node, then a variable setter.