0

基本的に、ポーカークライアントプログラムはファイル(txt)をハンドヒストリーログとして生成します。ハンドヒストリーを自動的に編集するプログラムが必要です。数字の前に「$」記号を追加するだけで、新しいディレクトリに新しいtxtファイルが生成されます。新しく作成されたファイルは別のソフトウェアで分析されます。

以下は、サンプルのハンドヒストリーログです。

Full Tilt Poker Game #23461961057: Table .COM Play 463 (deep) - 3000/6000 - No Limit Hold'em - 15:16:29 ET - 2010/08/29  
Seat 2: Player1 (795,425)  
Seat 5: Player2 (1,200,000)  
Player1 posts the small blind of 3,000  
Player2 posts the big blind of 6,000  
The button is in seat #2  
**** HOLE CARDS ****
Dealt to Player1 [Ac 4c]  
Player1 raises to 12,000  
Player2 raises to 687,000  
Player1 raises to 795,425, and is all in  
Player2 folds  
Player2 adds 687,000  
Uncalled bet of 108,425 returned to Player1  
Player1 mucks  
Player1 wins the pot (1,374,000)  
*** SUMMARY ***  
Total pot 1,374,000 | Rake 0  
Seat 2: Player1 (small blind) collected (1,374,000), mucked  
Seat 5: Player2 (big blind) folded before the Flop  

以下は私が欲しい処理されたファイルです:

Full Tilt Poker Game #23461961057: Table .COM 463 (deep) - $3000/$6000 - No Limit Hold'em - 15:16:29 ET - 2010/08/29
Seat 2: Player1 ($795,425)
Seat 5: Player2 ($1,200,000)
Player1 posts the small blind of $3,000
Player2 posts the big blind of $6,000
The button is in seat #2
*** HOLE CARDS ***
Dealt to Player1 [Ac 4c]
Player1 raises to $12,000
Player2 raises to $687,000
Player1 raises to $795,425, and is all in
Player2 folds
Player2 adds $687,000
Uncalled bet of $108,425 returned to Player1
Player1 mucks
Player1 wins the pot ($1,374,000)
*** SUMMARY ***
Total pot $1,374,000 | Rake $0
Seat 2: Player1 (small blind) collected ($1,374,000), mucked
Seat 5: Player2 (big blind) folded before the Flop

私はいくつかの調査を行い、このようなことをした結果としてAutoHotKeyを思いつきましたが、プログラミングに関しては初心者であり、これを入力しているときに正規表現が私の脳をレイプしています。どんな助けでもいいでしょう。

4

1 に答える 1

1
(?<!Seat )(?<![a-zA-Z#])([0-9]+(?:,[0-9]+)*)

$\1 で置換

基本的に、これが行うことは、「#」または文字またはシートで始まらない、コンマで区切ることができるすべての数字を見つけることです (文字列「Full Tilt Poker Game #23461961057」および「Seat 2」で気づいたので) 、あなたは $ を追加しませんでした)。アルゴリズムは貪欲であるため、コンマで割った数の各コンマの後にパターンが繰り返されるという事実を考慮に入れる必要があります。

JavaScript を使用している場合、残念ながら後ろ向きは使用できません。

于 2010-11-02T14:20:07.827 に答える