Prevent users from setting JOBSERIAL and from setting variables with invalid names.
[whenjobs.git] / lib / whenutils.ml
index 9614ef8..cdfca47 100644 (file)
@@ -41,6 +41,9 @@ module StringSet = Set.Make (String)
 
 let (//) = Filename.concat
 
+let isalpha = function 'a'..'z' | 'A'..'Z' -> true | _ -> false
+let isalnum = function 'a'..'z' | 'A'..'Z' | '0'..'9' -> true | _ -> false
+
 let rec filter_map f = function
   | [] -> []
   | x :: xs ->