preg_match允许PHP Preg_match()中的字母,数字和一些特殊字符

时间:2017-05-15 08:07:14

标签: php preg-match

我在下面用PHP Preg_match()

创建了一个preg_match

preg_match(" / ^ [a-zA-Z - :] {5,15} $ /")

根据我的情况

  1. 它应该只包含大写和小写字母。
  2. 不应包含数字。
  3. 一些特殊字符,如(:, - )
  4. 也允许空间。
  5. 但我的代码是接受数字,#,逗号(,)特殊字符。

0 个答案:

没有答案