-
Notifications
You must be signed in to change notification settings - Fork 128
Open
Description
Can we have support for such a function which supports regex dispatcher which supports groups
(defun create-regex-dispatcher-with-groups (regex handler)
(let ((scanner (cl-ppcre:create-scanner regex)))
(lambda (request)
(multiple-value-bind (matchedp groups)
(cl-ppcre:scan-to-strings scanner (hunchentoot:script-name request))
(when matchedp
(apply handler request (map 'list #'identity groups)))))))
I would like to define a regex like this
(push
(create-regex-dispatcher-with-groups
"^/hhub/nstcustomeraddress/([0-9]{10})$"
'hhub-get-address-by-phone)
hunchentoot:*dispatch-table*)
the function should have support for multiple arguments like phone here.
(defun hhub-get-address-by-phone (request phone)
(declare (ignore request))
(format t "Phone number: ~A~%" phone))
Metadata
Metadata
Assignees
Labels
No labels