mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-15 11:56:50 +00:00
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.
This commit is contained in:
+1
-1
@@ -693,7 +693,7 @@ string:
|
||||
|
||||
.. code-block:: jinja
|
||||
|
||||
{% if phone matches '{^[\d\.]+$}' %}
|
||||
{% if phone matches '/^[\\d\\.]+$/' %}
|
||||
{% endif %}
|
||||
|
||||
Containment Operator
|
||||
|
||||
Reference in New Issue
Block a user