Skip to content

Strings, formatting, regex, and data

String operations live in Set Variable. Use String result Variables for text and Number/List/Dictionary destinations where the selected operation returns those types.

Available families include join, length, repeat, trim, split, case conversion, replace/remove, substring index, prefix/suffix checks, and matching. String positions exposed as character indices start at 1. A substring index search returns 0 when no match is found.

A String operation’s matching/case/regex tags change its behavior. Literal replacement and regex replacement are not interchangeable. Read the selected tags before copying a pattern from another tool.

Set Variable → Split String
Result: Private List<String> words
Text: red,blue
Separator: ,

The output is a typed String list. Use a separator String, not a Number or a List element placeholder.

Capture groups extract part of a match:

Operation: Get Regex Capture Group
Result: Private String digits
Text: Round 12
Pattern: Round ([0-9]+)
Group Number: 1

The result is 12. Group 0 means the whole match; capture group 1 is the first parenthesized capture. This numbering is separate from List indexing. Get All Regex Groups returns a List<String> that includes the whole match as its first list element; that element is list index 1.

Named groups use syntax such as (?<digits>[0-9]+). Get All Named Regex Groups returns Dictionary<String,String>; the named-group operation reads by its name. No match gives an empty String/list/dictionary as appropriate. Requesting an unavailable numbered group on an actual match reports an error.

The bounded engine supports literals, ., character classes/ranges, anchors, alternation, capturing/noncapturing/named groups, and common repetition forms (*, +, ?, {n}, {n,m}), including lazy repetition. It does not support lookarounds, embedded flags, or backreferences. Named-group names use letters/digits; do not assume every external regex extension is accepted.

Patterns are limited to 512 characters, input to 32,768, nesting to 32, capture groups to 255, compiled states to 4,096, and shared work to 1,000,000 units. Bounded repetition counts cannot exceed 1,024. Limits are fatal resource failures rather than ordinary catchable regex mismatches.

Translate Legacy Colors converts supported legacy formatting. Get Text Content/Clear Formatting obtain plain content from the supported formatted text representation; Get Text Content Length measures that content rather than the raw formatting syntax. Test formatting in the actual message/action you intend to use.

Expressions insert values into text; regex searches/matches text. They are separate languages with different operators and escaping. See expressions before combining them.

Convert Value to JSON serializes supported typed data. Convert JSON to Value uses the destination’s declared type to validate the result. Example: String 10 decoded into a Number destination produces Number 10. A JSON document with a different type/shape fails validation.

Encode/Decode Base64 operate on text through UTF-8. Compress to Gzip returns Base64-encoded compressed UTF-8 text; Decompress expects that representation and applies a bounded output limit. Encoding is not encryption. These operations do not execute JSON/text as code.

Format Timestamp takes seconds and a format String and uses UTC; keep that unit consistent with the Timestamp Game Value. Use a simple format such as yyyy-MM-dd before introducing more elaborate patterns.