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.
我想匹配项目 id,看起来像:
a1234... b5678... c9876... ...
如何编写仅匹配前五个字符的正则表达式
第一个是字母,2-5是整数
preg_match_all('/[a-z]\d{2,5}/', $subject, $result, PREG_PATTERN_ORDER); for ($i = 0; $i < count($result[0]); $i++) { # Matched text = $result[0][$i]; }