Regex
Create Java-style regular expressions, find matching substrings, and replace the first match. These patterns use regex syntax rather than Luau string-pattern syntax.
Functions
Regex:MatchFind the first substring that matches this regular expression. Use it to extract a first value or check that text matches an anchored pattern. Test against nil when an empty-string match is also possible.
Regex:MatchManyFind all successive matches of this regular expression in the supplied text. Use it to extract repeated tokens from a document. Each result is the complete match rather than a separate capture-group record.
Regex:ReplaceReplace the first matching substring and return the resulting text. Use it for a single targeted edit, such as replacing the first version number in a label. Later matches stay unchanged.
Regex.EscapeQuote literal text so it can be included in a regex without interpreting its punctuation as pattern syntax. Use it when literal user input becomes part of a larger pattern. Characters such as dots and brackets then match themselves instead of acting as regex operators.
Regex.newCreate a reusable regular-expression object from a pattern. Patterns use the Java regular-expression engine. Compile once and reuse the object for repeated searches, input validation, or text cleanup. Use anchors such as ^ and $ when the whole input must match.