Tuesday, July 21, 2009

myfaces-extval and pattern based validation

i saw that people search quite often for an example which shows pattern/regex based validation.
it's quite easy. just use @Pattern and use the regex as value (as expected).

a short example is:
@Pattern("[A-Z][a-z]+")

the examples shipped with every extval release shows the usage as well.
or you can check out the examples from the repository.