We should validate input attributes like pattern or minlength on the server side.
For that we could automatically assign the corresponding validators from IPL Validator (existing or new ones) to the element.
Example
The following example should get the ipl\Validator\BetweenValidator:
$this->addElement(
'number',
'example',
[
'label' => 'Example',
'min' => 1,
'max' => 5
]
);