![wink.gif](http://phpforum.su/html/emoticons/wink.gif)
_____________
Принимаю заказы, писать в ЛС
preg_match_all('#' . preg_quote('*** SHOW DOWN ***') . '\s([^\*]+' . preg_quote($nick) . '[^\*]+)\s' . preg_quote('*** SUMMARY ***') . '#Uis', $contents, $result);
print_r($result[1]);
Цитата |
собирает всё, и то где нет Super |
$nick = 'Super';
$str =
'Seat 1: Joker_SJ
Seat 2: Super
Seat 3: 1e_st@t
Seat 4: Vendo71
Seat 6: leberwurst99
1e_st@t: posts small
Vendo71: posts big
Aaron6565: sits out
*** DEALING HANDS ***
Dealt to Super
leberwurst99: raises
Joker_SJ: calls
Super: raises
1e_st@t: folds
Vendo71: folds
leberwurst99: calls
Joker_SJ: raises
Super: folds
leberwurst99: calls
leberwurst99: discards
Joker_SJ: discards
*** SHOW DOWN ***
leberwurst99: shows
Joker_SJ: shows
leberwurst99 collected
*** SUMMARY ***
Seat 1: Joker_SJ showed
Seat 2: Super (button)
Seat 3: 1e_st@t (small)
Seat 4: Vendo71 (big)
Seat 6: leberwurst99 showed
Seat 2: Super
Seat 3: 1e_st@t
Seat 4: Vendo71
Seat 5: Aaron6565
Seat 6: leberwurst99
Vendo71: posts small
Aaron6565: posts big
*** DEALING HANDS ***
Dealt to Super
leberwurst99: folds
Super: raises
1e_st@t: folds
Vendo71: calls
Aaron6565: folds
leberwurst99 said, ":)"
Vendo71: discards 2 cards
Super: discards
Dealt to Super
Vendo71: checks
Super: checks
*** SHOW DOWN ***
Super: mucks
Vendo71: shows
Vendo71 collected
*** SUMMARY ***
Seat 2: Super mucked
Seat 3: 1e_st@t (button)
Seat 4: Vendo71 (small)
Seat 5: Aaron6565 (big)
Seat 6: leberwurst99 folded
';
$nick = preg_quote("Super");
$pattern = preg_quote("SHOW DOWN ***(.*)*** SUMMARY");
$pattern = strtr($pattern, array('\(\.\*\)'=>'(\r\n'. $nick.'.*)'));
echo $pattern;
preg_match("#".$pattern."#Usu", $str, $m);
echo '<pre>' . print_r($m[1], 1) . '</pre>';
Цитата |
Super: mucks Vendo71: shows Vendo71 collected |