Skip to content

Instantly share code, notes, and snippets.

View ericdorsey's full-sized avatar

Eric Dorsey ericdorsey

View GitHub Profile
@ericdorsey
ericdorsey / parse_chess_com_pgn.md
Created February 16, 2020 06:21
Parse a Chess.com PGN w/ Vim Regex

Parse A Chess.com PGN With Vim Regex

Copy only the moves part of a Chess.com PGN, including the game result into Vim:

1. e4 {[%clk 0:02:59.9]} 1... e5 {[%clk 0:02:55.1]} 2. Nf3 {[%clk 0:02:58.7]}
2... Nc6 {[%clk 0:02:53.6]} 3. Bb5 {[%clk 0:02:57.1]} 3... a6 {[%clk 0:02:51.3]}
                ... // SNIP // ...
0:00:04.4]} 49. Kf4 {[%clk 0:00:01.3]} 49... g5+ {[%clk 0:00:03.9]} 50. Kf5
{[%clk 0:00:00.4]} 50... Bd3+ {[%clk 0:00:03.4]} 0-1