The cl-match-patterns Reference Manual

This is the cl-match-patterns Reference Manual, version 0.0.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Fri May 15 11:54:13 2026 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 cl-match-patterns

Describe cl-match-patterns here

Author

Artyom Bologov

Home Page

https://codeberg.org/aartaka/cl-match-patterns

Source Control

(GIT https://codeberg.org/aartaka/cl-match-patterns.git)

Bug Tracker

https://codeberg.org/aartaka/cl-match-patterns/issues

License

BSD-2 Clause

Version

0.0.0

Dependencies
  • cl-ppcre (system).
  • quri (system).
Source

cl-match-patterns.asd.

Child Components

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


3.1 Lisp


3.1.1 cl-match-patterns/cl-match-patterns.asd

Source

cl-match-patterns.asd.

Parent Component

cl-match-patterns (system).

ASDF Systems

cl-match-patterns.


3.1.2 cl-match-patterns/package.lisp

Source

cl-match-patterns.asd.

Parent Component

cl-match-patterns (system).

Packages

cl-match-patterns.


3.1.3 cl-match-patterns/cl-match-patterns.lisp

Dependency

package.lisp (file).

Source

cl-match-patterns.asd.

Parent Component

cl-match-patterns (system).

Public Interface
Internals

-> (macro).


4 Packages

Packages are listed by definition order.


4.1 cl-match-patterns

‘cl-match-patterns’ package provides two main entry points:

- ‘parse’ takes a string representation of a match pattern and returns a more structured ‘pattern’

- ‘match’ takes a URL (string of quri:uri) to match and the ‘pattern’ to match; and returns whether these match.

‘pattern’ class is the structured representation of the match pattern, with ‘scheme’, ‘host’, and ‘path’ being its parts.

‘parse’ and ‘match’ throw ‘malformed-pattern’ when the pattern is broken.

Source

package.lisp.

Use List

common-lisp.

Public Interface
Internals

-> (macro).


5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


5.1 Public Interface


5.1.1 Ordinary functions

Function: match (url pattern)

Match the URL against the PATTERN. Returns four boolean values:
- Whether the URL matches PATTERN as a whole - Whether the scheme matched
- Whether the host matched
- Whether the path matched

Package

cl-match-patterns.

Source

cl-match-patterns.lisp.

Function: parse (pattern &key use-pathnames-p)

Parse the string PATTERN into a ‘pattern’ object.
Throws a lot of errors on malformed PATTERN, so tread carefully and catch. In case USE-PATHNAMES-P is true, use pathnames for URL paths. Stricter in path checking, but doesn’t allow partially wild path
components (/a*/)

Package

cl-match-patterns.

Source

cl-match-patterns.lisp.


5.1.2 Generic functions

Generic Reader: host (object)
Generic Writer: (setf host) (object)
Package

cl-match-patterns.

Methods
Reader Method: host ((pattern pattern))
Writer Method: (setf host) ((pattern pattern))

Match the host/domain of the URL.
Possible values:
- :WILDCARD – match any host
- (:WILDCARD HOST) – match any host/domain under a given HOST - A string – match whole host literally

Source

cl-match-patterns.lisp.

Target Slot

host.

Generic Reader: malformed-pattern-pattern (condition)
Package

cl-match-patterns.

Methods
Reader Method: malformed-pattern-pattern ((condition malformed-pattern))
Source

cl-match-patterns.lisp.

Target Slot

pattern.

Generic Reader: malformed-pattern-problem (condition)
Package

cl-match-patterns.

Methods
Reader Method: malformed-pattern-problem ((condition malformed-pattern))
Source

cl-match-patterns.lisp.

Target Slot

problem.

Generic Reader: path (object)
Generic Writer: (setf path) (object)
Package

cl-match-patterns.

Methods
Reader Method: path ((pattern pattern))
Writer Method: (setf path) ((pattern pattern))

Match the path of the URL.
- :WILDCARD – match any path and query
- A string – match a regex string against the provided path and query - A pathname – to be matched with ‘pathname-match-p’

Source

cl-match-patterns.lisp.

Target Slot

path.

Generic Reader: scheme (object)
Generic Writer: (setf scheme) (object)
Package

cl-match-patterns.

Methods
Reader Method: scheme ((pattern pattern))
Writer Method: (setf scheme) ((pattern pattern))

Match scheme of the URL.
Possible values:
- :WILDCARD – match http, https, ws, wss (when configured in ‘match’)
- :TRUE-WILDCARD – match any scheme (never use directly, only when ‘parse’-d) - A string – match literal scheme in its entirety.

Source

cl-match-patterns.lisp.

Target Slot

scheme.


5.1.3 Conditions

Condition: malformed-pattern
Package

cl-match-patterns.

Source

cl-match-patterns.lisp.

Direct superclasses

error.

Direct methods
Direct slots
Slot: pattern
Initargs

:pattern

Readers

malformed-pattern-pattern.

Writers

This slot is read-only.

Slot: problem
Initargs

:problem

Readers

malformed-pattern-problem.

Writers

This slot is read-only.


5.1.4 Classes

Class: pattern

Representation of a match pattern prepared for ‘match’-ing.
Uses regex strings in ‘path’ and ‘query’ and literal strings in ‘scheme’ and ‘host’. All the otherwise, allows :WILDCARD in most cases and some special values on top.

Package

cl-match-patterns.

Source

cl-match-patterns.lisp.

Direct methods
Direct slots
Slot: scheme

Match scheme of the URL.
Possible values:
- :WILDCARD – match http, https, ws, wss (when configured in ‘match’)
- :TRUE-WILDCARD – match any scheme (never use directly, only when ‘parse’-d) - A string – match literal scheme in its entirety.

Type

(or string (eql :wildcard) (eql :true-wildcard))

Initargs

:scheme

Readers

scheme.

Writers

(setf scheme).

Slot: host

Match the host/domain of the URL.
Possible values:
- :WILDCARD – match any host
- (:WILDCARD HOST) – match any host/domain under a given HOST - A string – match whole host literally

Type

(or string (eql :wildcard) (cons (eql :wildcard) (cons string null)))

Initargs

:host

Readers

host.

Writers

(setf host).

Slot: path

Match the path of the URL.
- :WILDCARD – match any path and query
- A string – match a regex string against the provided path and query - A pathname – to be matched with ‘pathname-match-p’

Type

(or string pathname (eql :wildcard))

Initargs

:path

Readers

path.

Writers

(setf path).


5.2 Internals


5.2.1 Macros

Macro: -> (name (&rest arg-types) &optional return-type)

Shorter ftype declaration for NAME.

Package

cl-match-patterns.

Source

cl-match-patterns.lisp.


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   (   -  
F   G   H   M   P   S  
Index Entry  Section

(
(setf host): Public generic functions
(setf host): Public generic functions
(setf path): Public generic functions
(setf path): Public generic functions
(setf scheme): Public generic functions
(setf scheme): Public generic functions

-
->: Private macros

F
Function, match: Public ordinary functions
Function, parse: Public ordinary functions

G
Generic Function, (setf host): Public generic functions
Generic Function, (setf path): Public generic functions
Generic Function, (setf scheme): Public generic functions
Generic Function, host: Public generic functions
Generic Function, malformed-pattern-pattern: Public generic functions
Generic Function, malformed-pattern-problem: Public generic functions
Generic Function, path: Public generic functions
Generic Function, scheme: Public generic functions

H
host: Public generic functions
host: Public generic functions

M
Macro, ->: Private macros
malformed-pattern-pattern: Public generic functions
malformed-pattern-pattern: Public generic functions
malformed-pattern-problem: Public generic functions
malformed-pattern-problem: Public generic functions
match: Public ordinary functions
Method, (setf host): Public generic functions
Method, (setf path): Public generic functions
Method, (setf scheme): Public generic functions
Method, host: Public generic functions
Method, malformed-pattern-pattern: Public generic functions
Method, malformed-pattern-problem: Public generic functions
Method, path: Public generic functions
Method, scheme: Public generic functions

P
parse: Public ordinary functions
path: Public generic functions
path: Public generic functions

S
scheme: Public generic functions
scheme: Public generic functions