You're quite right, this wiki page was written since the previous post, but it only covers defining the server side constraint.
There is still a missing piece of documentation and this is how to create the related JavaScript validation on the client side (if indeed you need it).
As a starting point you need to look at the setupConstraints() methods in the various ComponentGenerator classes in the org.alfresco.web.bean.generator package.