Regex allows only 1 character

后端 未结 6 1435
长情又很酷
长情又很酷 2021-01-22 03:50
$rex = \'/^[^<,\"@?=>|;#]$/i\';

I\'m having trouble with this regular expression. The idea is that the input fields are checked for certain chara

6条回答
  •  清歌不尽
    2021-01-22 03:56

    ^ means beginning of line
    $ means end of line
    [] means match one out of a group of character

    You will match lines containing one and only one among that list.

提交回复
热议问题