cl-match-patterns

2026-01-01

Describe cl-match-patterns here

Upstream URL

Author

Artyom Bologov

License

BSD-2 Clause
README

1cl-match-patterns

cl-match-patterns is a library supporting [[https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Match_patterns][match patterns as seen in major browsers]].

Might be useful for lightweight URL matching or interop with web engines like WebKit. Otherwise it’s just a minor nerd snipe for a Web standards freak like me ὠ9

1.1Getting Started

Clone the Git repository:
  git clone --recursive https://codeberg.org/aartaka/cl-match-patterns ~/common-lisp/

And then load :cl-match-patterns in the REPL:

  (asdf:load-system :cl-match-patterns)
  ;; or, if you use Quicklisp
  (ql:quickload :cl-match-patterns)

And then use either of the APIs:

  (cl-match-patterns:parse "*://*/*")
  ;; => #<CL-MATCH-PATTERNS:PATTERN {12033506B3}>
  (cl-match-patterns:parse "*://")
  ;; CL-MATCH-PATTERNS:MALFORMED-PATTERN: Cannot parse pattern '*://' because path is mandatory (even if a mere '/')
  (cl-match-patterns:match "https://aartaka.me" (cl-match-patterns:parse "*://*/*"))
  ;; => T, T, T, T

In case you prefer CLI interaction, you can run tests with make check and get a development-ready REPL / Swank / Slynk with make repl / make swank / make slynk.

1.2Examples

See ./tests/tests.lisp or match patterns documentation for numerous examples of match patterns.

Dependencies (3)

  • cl-ppcre
  • lisp-unit2
  • quri

Dependents (0)

    • GitHub
    • Quicklisp