diff --git a/site/content/docs/02-template-syntax.md b/site/content/docs/02-template-syntax.md index 119488aacc..97ba63f956 100644 --- a/site/content/docs/02-template-syntax.md +++ b/site/content/docs/02-template-syntax.md @@ -141,6 +141,13 @@ Text can also contain JavaScript expressions:

{a} + {b} = {a + b}.

``` +--- + +However, if you're using regular expression literal that starts with `/`, you'll need to wrap it in parentheses. + +```sv +
{(/^[A-Za-z ]+$/).test('value') ? 'foo' : 'bar'}
+``` ### Comments