$re = '/^[^|]*(?:\|[^|]*){58}$/m';
$str = '10001|W20101|W20101|G00001||||學徒劍盾|8|9|768||-1|1||||||||40002||||||1|14||2||40027|40028|40029|40030||2|22|113|||||||||||2|50|100|7|||||
10002|W30101|W30101|G00001||||學徒大斧|9|9|768||-1|1||||||||40003||||||1|17||3||40031|40032|40033|40034||2|26|142|||||||||||2|50|100|9|||||
10479|I00208||G00005||||青鐵礦|29||0||-1|30||||3|||||||||100|5|1||54|$53$原始的礦石,整體泛著鐵青的色澤。
#IMG$NoticeIcon#30~45級的副本掉落或跟公會商人購買。
$7$能與其他材料結合,製作40級的合金材料。
|||||||||||||||||||||||||||';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php