Fixed the `matches` operator code example
authorBrandon Kelly <brandon@pixelandtonic.com>
Mon, 28 Jul 2014 18:33:46 +0000 (11:33 -0700)
committerBrandon Kelly <brandon@pixelandtonic.com>
Mon, 28 Jul 2014 18:37:46 +0000 (11:37 -0700)
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

index aff036d..82b6f0c 100644 (file)
@@ -693,7 +693,7 @@ string:
 
     .. code-block:: jinja
 
-        {% if phone matches '{^[\d\.]+$}' %}
+        {% if phone matches '/^[\\d\\.]+$/' %}
         {% endif %}
 
 Containment Operator