1: <?php
2: /**
3: * Wei Framework
4: *
5: * @copyright Copyright (c) 2008-2015 Twin Huang
6: * @license http://opensource.org/licenses/mit-license.php MIT License
7: */
8:
9: namespace Wei\Validator;
10:
11: /**
12: * Check if the input contains letters (a-z) and digits (0-9)
13: *
14: * @author Twin Huang <twinhuang@qq.com>
15: */
16: class Alnum extends Regex
17: {
18: protected $patternMessage = '%name% must contain letters (a-z) and digits (0-9)';
19:
20: protected $negativeMessage = '%name% must not contain letters (a-z) or digits (0-9)';
21:
22: protected $pattern = '/^([a-z0-9]+)$/i';
23: }
24: