Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要对字符a-z、0-9和. 但是我需要一些更多的单个字符。_-Like ç, Ç, ş, Ş.
a-z
0-9
_
-
Like ç, Ç, ş, Ş.
protected function validate_alpha_dash($attribute, $value) { return preg_match('/^([-a-z0-9_-])+$/i', $value); }
我的图案应该是什么样子的?我需要再添加 10 个字符。
只需在括号之间添加它们,确保它们位于-字符类的末尾:
protected function validate_alpha_dash($attribute, $value) { return preg_match('/^([a-z0-9_çÇşŞ-])+$/i', $value); }