FOSSology  4.4.0
Open Source License Compliance by Open Source Software
ojoregex.hpp File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SPDX_LICENSE_LIST   "spdx-licen[cs]e(?:id|[- ]identifier): \\K((?:(?: (?:and|or|with) )?\\‍(?(?:[\\w\\d\\.\\+\\-]{3,})\\‍)?){1,5})"
 Regex to filter the list of licenses. More...
 
#define SPDX_LICENSE_NAMES   "(?: and | or | with )?\\‍(?([\\w\\d\\.\\+\\-]{1,}[\\w\\d\\+])\\‍)?"
 Regex to filter license names from list of license list. More...
 
#define SPDX_DUAL_LICENSE   "(?: (and|or|with)? )"
 Regex to check if Dual-license. More...
 

Detailed Description

The list of regex used in the agent.

Each regex is stored as a macro.

Definition in file ojoregex.hpp.

Macro Definition Documentation

◆ SPDX_DUAL_LICENSE

#define SPDX_DUAL_LICENSE   "(?: (and|or|with)? )"

Regex to check if Dual-license.

  1. Check if the license string contains or, with or and.

Definition at line 41 of file ojoregex.hpp.

◆ SPDX_LICENSE_LIST

#define SPDX_LICENSE_LIST   "spdx-licen[cs]e(?:id|[- ]identifier): \\K((?:(?: (?:and|or|with) )?\\‍(?(?:[\\w\\d\\.\\+\\-]{3,})\\‍)?){1,5})"

Regex to filter the list of licenses.

  1. The regex first finds occurance of spdx-license-identifier in the text
  2. Throw the text spdx-license-identifier
  3. Matches at most 5 identifiers each with length greater than 3 (based on https://github.com/spdx/license-list-data/tree/master/html)

Definition at line 24 of file ojoregex.hpp.

◆ SPDX_LICENSE_NAMES

#define SPDX_LICENSE_NAMES   "(?: and | or | with )?\\‍(?([\\w\\d\\.\\+\\-]{1,}[\\w\\d\\+])\\‍)?"

Regex to filter license names from list of license list.

  1. License names will consist of words, digits, dots and hyphens.
  2. Length of license names greater than 2 (based on https://github.com/spdx/license-list-data/tree/master/html)
  3. License name should end with a word, digit or +

Definition at line 34 of file ojoregex.hpp.