Performs a Regex match and returns 1
if the given pattern matches and 0
if not.
@{ variable | match (regex) }
"/pattern/"
.Note that you will have to use double backslashes
\\
to escape reserved characters in regex patterns.
The following example checks whether a template name contains the word post
and therefore uses a different date format:
<@ if @{ :template | match ('/post/') } @>
@{ date | dateFormat (@{ formatPost }) }
<@ else @>
@{ date | dateFormat (@{ formatProject }) }
<@ end @>