Regex related functionality. This functionality is bespoke (it does not use
any logic from Spdx-Java-Library
).
Regex related functionality. This functionality is bespoke (it does not use any logic from `Spdx-Java-Library`).
(addition-ref-re)
Returns a regex (Pattern
) that matches any SPDX AdditionRef
. The regex
provides these named capturing groups:
AdditionDocumentRef
(optional) - captures the DocumentRef
tag of an
AdditionRef
, if it contains oneAdditionRef
(always present) - captures the AdditionRef
tag of an
AdditionRef
Notes:
Pattern
object on subsequent calls, so is efficient when
called many timesReturns a regex (`Pattern`) that matches any SPDX `AdditionRef`. The regex provides these named capturing groups: * `AdditionDocumentRef` (optional) - captures the `DocumentRef` tag of an `AdditionRef`, if it contains one * `AdditionRef` (always present) - captures the `AdditionRef` tag of an `AdditionRef` Notes: * returns the same `Pattern` object on subsequent calls, so is efficient when called many times
(build-re ids)
(build-re ids
{:keys [match-license-refs? match-addition-refs?]
:or {match-license-refs? false match-addition-refs? false}
:as opts})
Returns a regex (Pattern
) that will match the given ids
(a sequence of
String
s), or nil
if ids
is nil
or empty. ids
appear in the regex
sorted from longest to shortest, so that more specific values are
preferentially matched first - this avoids mismatches when one id is a subset
of another id (e.g. GPL-2.0
and GPL-2.0-or-later
).
opts
are:
match-license-refs?
(default false
) - controls whether LicenseRef
matching is also included in the regexmatch-addition-refs?
(default false
) - controls whether AdditionRef
matching is also included in the regexNote:
Pattern
object on
every invocation, even if the arguments are the sameReturns a regex (`Pattern`) that will match the given `ids` (a sequence of `String`s), or `nil` if `ids` is `nil` or empty. `ids` appear in the regex sorted from longest to shortest, so that more specific values are preferentially matched first - this avoids mismatches when one id is a subset of another id (e.g. `GPL-2.0` and `GPL-2.0-or-later`). `opts` are: * `match-license-refs?` (default `false`) - controls whether `LicenseRef` matching is also included in the regex * `match-addition-refs?` (default `false`) - controls whether `AdditionRef` matching is also included in the regex Note: * _unlike_ other fns in this ns, this one returns a new `Pattern` object on every invocation, even if the arguments are the same
(exception-ids-re)
Returns a regex (Pattern
) that matches any SPDX exception identifier or
AdditionRef. The regex provides these named capturing groups:
Identifier
(always present) - captures the entire identifier or
AdditionRef
AdditionDocumentRef
(optional) - captures the DocumentRef
tag of an
AdditionRef
, if it contains oneAdditionRef
(optional) - captures the AdditionRef
tag of an AdditionRef
Notes:
Pattern
object on subsequent calls, so is efficient when
called many timesReturns a regex (`Pattern`) that matches any SPDX exception identifier or AdditionRef. The regex provides these named capturing groups: * `Identifier` (always present) - captures the entire identifier or `AdditionRef` * `AdditionDocumentRef` (optional) - captures the `DocumentRef` tag of an `AdditionRef`, if it contains one * `AdditionRef` (optional) - captures the `AdditionRef` tag of an `AdditionRef` Notes: * returns the same `Pattern` object on subsequent calls, so is efficient when called many times
(ids-re)
Returns a regex (Pattern
) that matches any SPDX license identifier,
exception identifier, LicenseRef
, or AdditionRef
. The regex provides
these named capturing groups:
Identifier
(always present) - captures the entire identifier, LicenseRef
or AdditionRef
DocumentRef
(optional) - captures the DocumentRef
tag of a LicenseRef
,
if it contains oneLicenseRef
(optional) - captures the LicenseRef
tag of a LicenseRef
AdditionDocumentRef
(optional) - captures the DocumentRef
tag of an
AdditionRef
, if it contains oneAdditionRef
(optional) - captures the AdditionRef
tag of an
AdditionRef
Notes:
Pattern
object on subsequent calls, so is efficient when
called many timesReturns a regex (`Pattern`) that matches any SPDX license identifier, exception identifier, `LicenseRef`, or `AdditionRef`. The regex provides these named capturing groups: * `Identifier` (always present) - captures the entire identifier, `LicenseRef` or `AdditionRef` * `DocumentRef` (optional) - captures the `DocumentRef` tag of a `LicenseRef`, if it contains one * `LicenseRef` (optional) - captures the `LicenseRef` tag of a `LicenseRef` * `AdditionDocumentRef` (optional) - captures the `DocumentRef` tag of an `AdditionRef`, if it contains one * `AdditionRef` (optional) - captures the `AdditionRef` tag of an `AdditionRef` Notes: * returns the same `Pattern` object on subsequent calls, so is efficient when called many times
(init!)
Initialises this namespace upon first call (and does nothing on subsequent
calls), returning nil
. Consumers of this namespace are not required to call
this fn, as initialisation will occur implicitly anyway; it is provided to
allow explicit control of the cost of initialisation to callers who need it.
Note: this method may have a substantial performance cost.
Initialises this namespace upon first call (and does nothing on subsequent calls), returning `nil`. Consumers of this namespace are not required to call this fn, as initialisation will occur implicitly anyway; it is provided to allow explicit control of the cost of initialisation to callers who need it. Note: this method may have a substantial performance cost.
(license-ids-re)
Returns a regex (Pattern
) that matches any SPDX license identifier or
LicenseRef
. The regex provides these named capturing groups:
Identifier
(always present) - captures the entire identifier or
LicenseRef
DocumentRef
(optional) - captures the DocumentRef
tag of a LicenseRef
,
if it contains oneLicenseRef
(optional) - captures the LicenseRef
tag of a LicenseRef
Notes:
Pattern
object on subsequent calls, so is efficient when
called many timesReturns a regex (`Pattern`) that matches any SPDX license identifier or `LicenseRef`. The regex provides these named capturing groups: * `Identifier` (always present) - captures the entire identifier or `LicenseRef` * `DocumentRef` (optional) - captures the `DocumentRef` tag of a `LicenseRef`, if it contains one * `LicenseRef` (optional) - captures the `LicenseRef` tag of a `LicenseRef` Notes: * returns the same `Pattern` object on subsequent calls, so is efficient when called many times
(license-ref-re)
Returns a regex (Pattern
) that matches any SPDX LicenseRef
. The regex
provides these named capturing groups:
DocumentRef
(optional) - captures the DocumentRef
tag of a LicenseRef
,
if it contains oneLicenseRef
(always present) - captures the LicenseRef
tag of a
LicenseRef
Notes:
Pattern
object on subsequent calls, so is efficient when
called many timesReturns a regex (`Pattern`) that matches any SPDX `LicenseRef`. The regex provides these named capturing groups: * `DocumentRef` (optional) - captures the `DocumentRef` tag of a `LicenseRef`, if it contains one * `LicenseRef` (always present) - captures the `LicenseRef` tag of a `LicenseRef` Notes: * returns the same `Pattern` object on subsequent calls, so is efficient when called many times
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close