Liking cljdoc? Tell your friends :D

spdx.regexes

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`).
raw docstring

addition-ref-reclj

(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 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
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 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
sourceraw docstring

build-reclj

(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 Strings), 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
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 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
sourceraw docstring

exception-ids-reclj

(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 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
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 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
sourceraw docstring

ids-reclj

(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 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
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 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
sourceraw docstring

init!clj

(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.
sourceraw docstring

license-ids-reclj

(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 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
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 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
sourceraw docstring

license-ref-reclj

(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 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
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 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
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close