Regular Expressions 101

Community Patterns

Return all trans in twigs

1

Regular Expression
PCRE (PHP <7.3)

/
\{\%\s(trans with \{.*\}|trans|transchoice)\s\%\}(.*)\{\%\s(endtrans|endtranschoice)\s\%\}
/
g

Description

Made to return all trans from symfony twigs

Submitted by Andrei Pit - 9 years ago