开发者

How to write Regular Expression for number,characters,alphanumeric

I am using Zend_Validate_Regex, I need开发者_运维知识库 the regular expression which has the following check,

  1. 123456 - Accepted
  2. 12345A - Accepted
  3. A12345 - Accepted
  4. ABCDEF - Accepted

Kindly help


Use this regex: (?i)^[\da-f]+$


If you are expecting an hexadecimal number, the regular expression is:

/[0-9A-F]*/

May be, you want to use also non capital letters:

/[0-9A-F]*/i

Or perhaps you want to use exactly 6 characters (numbers and letters):

/[0-9A-F]{6}/i
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜