-
How would I put a constraint on a string's length? Right now I've only figured out how to do it via regexes: #StrLen8: =~"^.{8}$"
{
v: #StrLen8
} {
"v": "hello123"
} This also requires 1 regex / length unless I'm missing something... |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
There is a PR pending to add But you could make regex's variable:
Scalar values may have definition fields associated with them. This is a fairly new feature and some syntax has been proposed to make this more natural. |
Beta Was this translation helpful? Give feedback.
-
Note that the |
Beta Was this translation helpful? Give feedback.
-
This discussion has been migrated to cue-lang/cue#657. For more details about CUE's migration to a new home, please see cue-lang/cue#1078. |
Beta Was this translation helpful? Give feedback.
There is a PR pending to add
NumRunes
too.But you could make regex's variable:
Scalar values may have definition fields associated with them. This is a fairly new feature and some syntax has been proposed to make this more natural.