When we need to work with regular expressions, these operators will help with your markdown.
Convert the given string to a regular expression.
Params
str
{String}returns
{RegExp}Example
{{toRegex "foo"}}
<!-- results in: /foo/ -->
Returns true if the given str
matches the given regex. A regex can be passed on the context, or using the toRegex helper as a subexpression.
Params
str
{String}returns
{RegExp}Example
{{test "bar" (toRegex "foo")}}
<!-- results in: false -->
{{test "foobar" (toRegex "foo")}}
<!-- results in: true -->
{{test "foobar" (toRegex "^foo$")}}
<!-- results in: false -->