Handbook
Glossary
v-regexp ( str what regexp -- str )
Form validators
Prev:
v-max-value ( x n -- x )
Next:
v-required ( str -- str )
Vocabulary
validators
Inputs
str
a
string
what
a
string
regexp
a
regexp
Outputs
str
a
string
Word description
Throws a validation error that
what
failed if the string does not match the regular expression.
Definition
USING:
kernel
regexp
sequences
;
IN:
validators
:
v-regexp
( str what regexp -- str )
3dup
nip
matches?
[
2drop
]
[
drop
"invalid "
prepend
throw
]
if
;