Is Match Formatter
Use the Is Match Formatter to evaluate regular expressions to control the output. The Is Match Formatter is not included by default. You can add it to the Formatters in the Smart Format Settings.
Note: In the options part of the formatter, not all RegEx characters are valid, for example curly braces and parentheses aren’t supported. This is because the same parser is used as for all other extensions.
Example Smart String | Arguments | Result |
---|---|---|
{theKey:ismatch(^.+123.+$):Okay - {}|No match content} |
|
Okay - Some123Content |
{theKey:ismatch(^.+123.+$):Fixed content if match|No match content} |
|
Fixed content if match |
{0:list:{:ismatch(^100|200|999$):{:0.00}|'no match'}|, | and } |
|
100.00, 200.00 and 'no match' |
{0:list:{:ismatch(^100|200|999$):'match'|'no match'}|, | and } |
|
'match', 'match' and 'no match' |