bstraehle commited on
Commit
4999f7f
·
verified ·
1 Parent(s): fe9beee

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -5
app.py CHANGED
@@ -51,12 +51,9 @@ def _noop(*args, **kwargs):
51
  gradio.utils.watchfn_spaces = _noop
52
 
53
  def validate_input(fen):
54
- is_valid = True
55
 
56
- if fen.len() > 100:
57
- is_valid = False
58
-
59
- return is_valid
60
 
61
  # Graphical user interface
62
 
 
51
  gradio.utils.watchfn_spaces = _noop
52
 
53
  def validate_input(fen):
54
+ fen_pattern = r'\b([rnbqkpRNBQKP1-8\/]+\s+[wb]\s+(?:-|[KQkq]+)\s+(?:-|[a-h][36])\s+\d+\s+\d+)\b'
55
 
56
+ return re.search(fen_pattern, fen)
 
 
 
57
 
58
  # Graphical user interface
59