Add key? to check if a string is a gamma key.

This commit is contained in:
2023-11-01 15:05:08 +02:00
parent e145382570
commit 1e45771b3e
2 changed files with 29 additions and 0 deletions
@@ -0,0 +1,9 @@
(ns cipher-analytical-machine.parsers.gamma
(:gen-class))
(defn key?
"Return true if the string is an key of three integers."
[str]
(if (re-matches #"[+-]?\b\d+\b,[+-]?\b\d+\b,[+-]?\b\d+\b" str)
true false))