It would be interesting to transcribe famous games and then review them turn by turn. Let’s start with a parser for the preferred notation.
PGN is definitely the preferred notation in the chess world.
Portable Game Notation (PGN) is a standard plain text format for recording chess games (both the moves and related data), which can be read by humans and is also supported by most chess software. wikipedia
Garry Kasparov vs Jorden van Foreest. chess
pages/better-chess
1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. Nxd4 Nf6 5. Nxc6 bxc6 6. e5 Qe7 7. Qe2 Nd5 8. c4 Qb4+ 9. Nd2 Nf4 10. Qe3 Ng6 11. Bd3 Bc5 12. Qg3 O-O 13. O-O d6 14. Nb3 Nxe5 15. a3 Qb6 16. Nxc5 Qxc5 17. Be3 Qa5 18. b4 Qa4 19. Bd4 f6 20. Bxe5 fxe5 21. f4 Bf5 22. fxe5 Bxd3 23. Qxd3 dxe5 24. Qd7 Qb3 25. Qxc6 Qe3+ 26. Kh1 Kh8 27. Rfe1 Qc3 28. Qxc7 Rac8 29. Qxa7 Rxc4 30. h3 Rcf4 31. Qc5 Qb2 32. Qxe5 Qb3 33. Qe3 Qc4 34. Rac1 Qf7 35. Qg3 h6 36. b5 Qd5 37. a4 Rxa4 38. Rb1 Rf5 39. b6 Rg5 40. b7 Qxb7 41. Qxg5 1-0
We start by splitting out individual moves. Next we write a series of regular expressions that will match each case present in our sample. github
/([KQRNB]?x?[a-h][1-8]) *([KQRNB]?x?[a-h][1-8])/
http://ward.dojo.fed.wiki/assets/pages/better-chess/parse.html HEIGHT 800