From 77e584616161738e7cb8a6908d2ed341f0241bc7 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 21 Feb 2020 09:29:07 +0100 Subject: [PATCH] Fix regression --- src/Lexer.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Lexer.php b/src/Lexer.php index 2de5fc79a..b93790c61 100644 --- a/src/Lexer.php +++ b/src/Lexer.php @@ -506,8 +506,9 @@ class Lexer implements \Twig_LexerInterface } // an operator that begins with a character must have a space before + // or a parenthesis if (ctype_alpha($operator[0])) { - $r = '(?<=\s)'.$r; + $r = '(?<=[\s(])'.$r; } // an operator with a space can be any amount of whitespaces