SnowWind
Новичок
Всем привет
Не знаю как написать регулярное выражение
Исходный текст
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
Super: shows
Super 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 ***
Vendo71: shows
Super: mucks
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
мне нужно собрать в массив такие отрывки
Vendo71: shows
Super: mucks
Vendo71 collected
т.е там где ПЕРЕД стоит SHOW DOWN в тексте ЕСТЬ пользователь Super, перед collected НЕТ Super, а ПОСЛЕ идёт SUMMARY
так собирает, но вместе с Super collected
preg_match_all('#' . preg_quote('*** SHOW DOWN ***') . '\s([^\*]+Super.*([^Super\s[collected]])[^\*]+)\s' . preg_quote('*** SUMMARY ***') . '#Uis', $contents, $result);
$lostgameshowdown = count($result[1]);
print_r($result[1]);
Не знаю как написать регулярное выражение
Исходный текст
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
Super: shows
Super 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, "
![](/talk/proxy.php?image=http%3A%2F%2Fforum.php.su%2Fim%2Femoticons%2Fsmile24.gif&hash=52ab6fbd580318a619db35aa44ea24d2)
Vendo71: discards 2 cards
Super: discards
Dealt to Super
Vendo71: checks
Super: checks
*** SHOW DOWN ***
Vendo71: shows
Super: mucks
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
мне нужно собрать в массив такие отрывки
Vendo71: shows
Super: mucks
Vendo71 collected
т.е там где ПЕРЕД стоит SHOW DOWN в тексте ЕСТЬ пользователь Super, перед collected НЕТ Super, а ПОСЛЕ идёт SUMMARY
так собирает, но вместе с Super collected
preg_match_all('#' . preg_quote('*** SHOW DOWN ***') . '\s([^\*]+Super.*([^Super\s[collected]])[^\*]+)\s' . preg_quote('*** SUMMARY ***') . '#Uis', $contents, $result);
$lostgameshowdown = count($result[1]);
print_r($result[1]);