mirror of
https://github.com/fenom-template/fenom.git
synced 2023-08-10 21:13:07 +03:00
824 B
824 B
Modifier match
Match string against a pattern.
The average user may be used to shell patterns or at least in their simplest form to ?
and *
wildcards so using match
instead of ematch
for frontend search expression input may be way more convenient for non-programming users.
{$string|match:$pattern}
Special pattern symbols:
?
— match one or zero unknown characters.?at
matchesCat
,cat
,Bat
orbat
but notat
.*
— match any number of unknown characters.Law*
matchesLaw
,Laws
, orLawyer
.[characters]
— Match a character as part of a group of characters.[CB]at
matchesCat
orBat
but notcat
,rat
orbat
.\
- Escape character.Law\*
will only matchLaw*
{if $color|match:"*gr[ae]y"}
some form of gray ...
{/if}