Regexp
The Regexp registry includes functions for pattern matching and string manipulation using regular expressions, providing powerful text processing capabilities.
regexFind / mustRegexFind
{{ regexFind "a(b+)" "aaabbb" }} // Output: "abbb"{{ "hello world" | mustRegexFind "hello" }} // Output: "hello", nil
{{ "hello world" | mustRegexFind "\invalid$^///" }} // Output: "", errorregexFindAll / mustRegexFindAll
{{ regexFindAll "a(b+)" "ababab" 2 }} // Output: ["ab", "ab"]{{ mustRegexFindAll "a.", "aba acada afa", 3 }} // Output: ["ab", "ac", "af"], nil
{{ mustRegexFindAll "\invalid$^///", "aba acada afa", 3 }} // Output: "", errorregexMatch / mustRegexMatch
{{ regexMatch "^[a-zA-Z]+$" "Hello" }} // Output: true{{ mustRegexMatch "^[a-zA-Z]+$", "Hello" }} // Output: true, nil
{{ mustRegexMatch "\invalid$^///", "Hello" }} // Output: false, errorregexSplit / mustRegexSplit
regexReplaceAll / mustRegexReplaceAll
regexReplaceAllLiteral / mustRegexReplaceAllLiteral
regexQuoteMeta
Last updated