From 894df76b36c53cb61aec79aaefc7352a8061880c Mon Sep 17 00:00:00 2001 From: Pierre Ducroquet Date: Wed, 4 Feb 2015 23:21:59 +0100 Subject: [PATCH] Introduce a new rule specific for username string This allows dots in username. --- src/parsers/command-db-uri.lisp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/parsers/command-db-uri.lisp b/src/parsers/command-db-uri.lisp index 661326b..bda4d1a 100644 --- a/src/parsers/command-db-uri.lisp +++ b/src/parsers/command-db-uri.lisp @@ -25,7 +25,14 @@ (defrule doubled-at-sign (and "@@") (:constant "@")) (defrule doubled-colon (and "::") (:constant ":")) (defrule password (+ (or (not "@") doubled-at-sign)) (:text t)) -(defrule username (and namestring (? (or doubled-at-sign doubled-colon))) +(defrule username-string (and (or #\_ (alpha-char-p character)) + (* (or (alpha-char-p character) + (digit-char-p character) + #\. + punct))) + (:text t)) + +(defrule username (and username-string (? (or doubled-at-sign doubled-colon))) (:text t)) (defrule dsn-user-password (and username