Regex Helpers
regex
Visit the: code | unit tests
{toRegex}
Convert the given string to a regular expression.
Params
str
Stringreturns
RegExp
Example
{{toRegex "foo"}}
{test}
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
Stringreturns
RegExp
Example
{{test "bar" (toRegex "foo")}}
{{test "foobar" (toRegex "foo")}}
{{test "foobar" (toRegex "^foo$")}}