From 33dcbc8c764af967e8745baaf3098f95abf501bc Mon Sep 17 00:00:00 2001 From: Brandon Kelly Date: Mon, 28 Jul 2014 11:33:46 -0700 Subject: [PATCH] Fixed the `matches` operator code example It wasn't working because the backslashes themselves needed to be escaped by additional backslashes. Also switched to using forwardslashes for the regex delimiters rather than curly brackets. --- doc/templates.rst | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/doc/templates.rst b/doc/templates.rst index aff036d..82b6f0c 100644 --- a/doc/templates.rst +++ b/doc/templates.rst @@ -693,7 +693,7 @@ string: .. code-block:: jinja - {% if phone matches '{^[\d\.]+$}' %} + {% if phone matches '/^[\\d\\.]+$/' %} {% endif %} Containment Operator -- 1.7.2.5