String functions
String arguments are strict strings unless a formatting verb explicitly accepts another value. length, substr, and strrev count Unicode grapheme clusters.
format and formatlist accept v, #v, t, b, d, o, x, X, e, E, f, g, G, s, and q, explicit argument positions, width, precision, and sign/alignment/zero-padding flags. %% emits a percent sign. Formatting is bounded; floating-point rounding follows Rust.
Without captures, regex results are strings; unnamed captures produce lists; named captures produce maps. Mixed named and unnamed capture styles fail. Patterns use Rust’s bounded regex engine, with no look-around or backreferences. Regex replacement supports capture substitutions such as $1 and ${name}; escape the latter as $${name} inside an HCL string. Rust Unicode classes can differ from Terraform’s RE2 behavior.
templatestring is covered under templates, and scalar conversion functions under conversion and sensitivity.
Example
All calls obey the function limits and annotation rules.