Answer the question
In order to leave comments, you need to log in
How can I use preg_match to find a word-bound string that contains a minus sign?
Syntax Smarty.
You need to determine exactly if the string contains one of the two words ( container or container-fluid ). In this form, for example , container-f returns false .
{if !preg_match('/\b(/container-fluid|container)\b/', $args['container']) !== false}
{capture append='container'}
container
{/capture}
{$container = implode(' ', $container)}
{/if}
Answer the question
In order to leave comments, you need to log in
Everything turned out to be easier than it seemed. Maybe someone will come in handy.
/\b(container$|container-fluid$)\b/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question