I'm trying to perform an input check in php for name tag, which consists of English, Chinese, and numbers.
"/^[A-z0-9\p{Han}]{2,12}$/u";
I would like to achieve the name tag rule of 12 units of character where a Chinese character is 2 unit and English/Number is 1 unit.
Can a regular expression match for such rule?
To give you some example:
六 matches because as of \p{Han} and 2 units
六1 matches because of 0-9, \p{Han}, and 3 units
1 does not match as of 1 unit
一二三四五六七 does not match as of 14 units