Regex template functions

These template functions let you search, match, and transform text with regular expressions. Use them when you need to extract specific parts of a string, validate formats, or replace patterns in sensor values.

Home Assistant extends the Jinja2 template engine with many custom functions, filters, and tests. Each function on this page has its own page with detailed descriptions, parameters, and practical examples.

New to templates? Start with the templating documentation to learn the basics.