Skip to content

Commit fbba5cc

Browse files
authored
use regex_match in constraint docs (#1953)
<!-- ELLIPSIS_HIDDEN --> > [!IMPORTANT] > Replaces `contains` with `regex_match` in `checks-and-asserts.mdx` for more precise pattern matching in `@assert` and `@check` attributes. > > - **Behavior**: > - Replaces `contains` with `regex_match` in `checks-and-asserts.mdx` for `@assert` and `@check` attributes in `Foo` class example. > - Specifically changes `bar_no_foo`, `bar_no_fizzle`, and `bar_no_baz` constraints to use `regex_match` for pattern matching. > > <sup>This description was created by </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=BoundaryML%2Fbaml&utm_source=github&utm_medium=referral)<sup> for 17d1025. You can [customize](https://app.ellipsis.dev/BoundaryML/settings/summaries) this summary. It will automatically update as commits are pushed.</sup> <!-- ELLIPSIS_HIDDEN -->
1 parent e9d699b commit fbba5cc

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

fern/01-guide/05-baml-advanced/checks-and-asserts.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,9 +303,9 @@ You can also chain multiple `@check` and `@assert` attributes on a single field.
303303
```baml BAML
304304
class Foo {
305305
bar string @check(bar_nonempty, {{ this|length > 0 }})
306-
@assert(bar_no_foo, {{ this|contains("foo") }})
307-
@check(bar_no_fizzle, {{ this|contains("fizzle") }})
308-
@assert(bar_no_baz, {{ this|contains("baz") }})
306+
@assert(bar_no_foo, {{ this|regex_match("foo") }})
307+
@check(bar_no_fizzle, {{ this|regex_match("fizzle") }})
308+
@assert(bar_no_baz, {{ this|regex_match("baz") }})
309309
}
310310
```
311311

0 commit comments

Comments
 (0)