1
0
mirror of https://github.com/maaslalani/gambit.git synced 2025-10-08 22:31:53 +02:00

doc: fen.IsValid

This commit is contained in:
Maas Lalani
2022-02-06 23:03:13 -05:00
parent f476062edb
commit 2d761df009

View File

@@ -8,6 +8,7 @@ import (
var fenRegex = regexp.MustCompile(`\s*([rnbqkpRNBQKP1-8]+\/){7}([rnbqkpRNBQKP1-8]+)\s[bw-]\s(([a-hkqA-HKQ]{1,4})|(-))\s(([a-h][36])|(-))\s\d+\s\d+\s*`)
// IsValid returns whether a FEN string is valid by checking a naive regular expression
func IsValid(fen string) bool {
return fenRegex.MatchString(fen)
}