docs: mention regexp literal as text expressions

pull/5640/head
Ignatius Bagus 5 years ago
parent c8334c8b28
commit aa9f7c2929
No known key found for this signature in database
GPG Key ID: 357C6674A45CC06B

@ -141,6 +141,13 @@ Text can also contain JavaScript expressions:
<p>{a} + {b} = {a + b}.</p>
```
---
However, if you're using regular expression literal that starts with `/`, you'll need to wrap it in parentheses.
```sv
<div>{(/^[A-Za-z ]+$/).test('value') ? 'foo' : 'bar'}</div>
```
### Comments

Loading…
Cancel
Save