Community Patterns

Community Library Entry

1

Regular Expression
Created·2016-01-16 14:15
Flavor·ECMAScript (JavaScript)

/
^((?:[NBRQK]([a-h1-8])?x?(?!\2)[a-h](?!\2)[1-8]|[NBRQK]x?[a-h][1-8]|(?:[a-h]x)?[a-h](?:[1-8](?:\(ep\))?|[18]=[NBRQ])|(?:0-){1,2}0)\+{0,2})$
/
Open regex in editor

Description

Detects SYNTACTICALLY correct chess moves (i.e. it doesn't check whether the move itself is actually valid)

Submitted by Terence Linnell