Matt Wette <[email protected]> skribis: > (regex-case str > (("^([a-z]+)\\(([0-9]+)\\)$" v i) > (list v i)) > (("^([a-z]+)$" v) > (list v "1”)))
Sounds useful and convenient! > (let ((t-292 (make-regexp "^([a-z]+)\\(([0-9]+)\\)$")) > (t-293 (make-regexp "^([a-z]+)$"))) > (cond ((regexp-exec t-292 str) > => > (lambda (m) > (let ((v (match:substring m 1)) > (i (match:substring m 2))) > (list v i)))) > ((regexp-exec t-293 str) > => > (lambda (m) > (let ((v (match:substring m 1))) (list v "1")))))) When the ‘else’ clause is missing, I think it would be best to throw an error like ‘match’ does—it’s rarely helpful to return #unspecified in those cases. Ludo’.
