Skip to content

Instantly share code, notes, and snippets.

@Jach
Last active July 22, 2020 22:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Jach/cf91e6cbbade7e1801b44f919a15d499 to your computer and use it in GitHub Desktop.
Save Jach/cf91e6cbbade7e1801b44f919a15d499 to your computer and use it in GitHub Desktop.
;(ql:quickload :cl-ppcre)
;(ql:quickload :cl-interpol)
;(named-readtables:in-readtable :interpol-syntax)
(defun full-match (pattern string)
"Something like Python's re.fullmatch.
Example (with cl-interpol):
(full-match #?/\s/ #?' ') -> T
(full-match #?/\s/ #?'') -> nil"
(equal string (cl-ppcre:scan-to-strings pattern string)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment