# first field is tag
# second field is a list of keyword in lower case separated by &&
# third field is a lower case sentence to match the license. Notes that space are normalized before and formating removed
# fourth field is a regex to use to match the license, use lower case and [ ] for space.
# 5th field is a regex to use for the first block (by default equal to 4th field)
# 6th field is a function to call if the field 2th to 5th match.
# (see dispatch table %LICENSE_CHECK_DISPATCH_TABLE

# json license
license-problem-json-evil ~~ software && evil && good ~~ software shall be used for good ~~ software [ ] shall [ ] be [ ] used [ ] for [ ] good [ ]? ,? [ ]? not [ ] evil
# non free RFC old version
license-problem-non-free-RFC ~~ document && purpose && translate && language ~~ this document itself may not be modified in any way ~~ this [ ] document [ ] itself [ ] may [ ] not [ ] be [ ] modified [ ] in [ ] any [ ] way [ ]?, [ ]? such [ ] as [ ] by [ ] removing [ ] the [ ] copyright [ ] notice [ ] or [ ] references [ ] to [ ] .{0,256} [ ]? except [ ] as [ ] needed [ ] for [ ] the [ ] purpose [ ] of [ ] developing [ ] .{0,128} [ ]? in [ ] which [ ] case [ ] the [ ] procedures [ ] for [ ] copyrights [ ] defined [ ] in [ ] the [ ] .{0,128} [ ]? process [ ] must [ ] be [ ] followed[ ]?,[ ]? or [ ] as [ ] required [ ] to [ ] translate [ ] it [ ] into [ ] languages [ ] ~~ ~~ rfc-whitelist-filename
license-problem-non-free-RFC-BCP78 ~~ license && document && bcp && restriction ~~ bcp 78 ~~ this [ ] document [ ] is [ ] subject [ ] to [ ] (?:the [ ] rights [ ]?, [ ] licenses [ ] and [ ]restrictions [ ] contained [ ] in [ ])? bcp [ ] 78 ~~ ~~ rfc-whitelist-filename
# check GFDL block - The ".{0,1024}"-part in the regex
# will contain the "no invariants etc."  part if
# it is a good use of the license.  We include it
# here to ensure that we do not emit a false positive
# if the "redeeming" part is in the next block
# keyword document is here in order to benefit for other license keyword and a shortcut for documentation
license-problem-gfdl-invariants ~~ license && document && gnu && copy && documentation ~~ gnu free documentation license ~~ (?'rawcontextbefore'(?:(?:(?!a [ ] copy [ ] of [ ] the [ ] license [ ] is).){1024}|(?:[ ] copy [ ] of [ ] the [ ] license [ ] is.{0,1024}?))) gnu [ ] free [ ] documentation [ ] license (?'rawgfdlsections'(?:(?!gnu [ ] free [ ] documentation [ ] license).){0,1024}?) (?:a [ ] copy [ ] of [ ] the [ ] license [ ] is|this [ ] document [ ] is [ ] distributed)  ~~ (?'rawcontextbefore'(?:(?:(?!a [ ] copy [ ] of [ ] the [ ] license [ ] is).){1024}|\A(?:(?!a [ ] copy [ ] of [ ] the [ ] license [ ] is).){0,1024}|(?:[ ] copy [ ] of [ ] the [ ] license [ ] is.{0,1024}?))) gnu [ ] free [ ] documentation [ ] license (?'rawgfdlsections'(?:(?!gnu [ ] free [ ] documentation [ ] license).){0,1024}?) (?:a [ ] copy [ ] of [ ] the [ ] license [ ] is|this [ ] document [ ] is [ ] distributed) ~~ license-problem-gfdl-invariants
# php license
license-problem-php-license ~~ www.php.net && group@php.net && phpfoo && conjunction && php ~~ this product includes php ~~ php [ ] license [ ]?[,;][ ]? version [ ] 3(?:\.\d+)? ~~ ~~ php-source-whitelist
license-problem-bad-php-license ~~ www.php.net && add-on && conjunction ~~ this product includes php ~~ php [ ] license [ ]?[,;][ ]? version [ ] 2(?:\.\d+)? ~~ ~~ php-source-whitelist
# cc by nc sa note that " is replaced by [ ]
license-problem-cc-by-nc-sa ~~ license && by-nc-sa && creativecommons.org  ~~ http://creativecommons.org/licenses/by-nc-sa ~~ license [ ] rdf:[^=:]+=[ ]* (?:ht|f)tps?://(?:[^/.]\.)??creativecommons\.org/licenses/by-nc-sa/\d+(?:\.\d+)?(?:/[[:alpha:]]+)?/? [ ]* >
# not really a license but warn it: visual c++ generated file
source-contains-autogenerated-visual-c++-file ~~ microsoft && visual && generated ~~ microsoft visual c++ generated ~~ microsoft [ ] visual [ ] c[+][+] [ ] generated (?![ ] by [ ] freeze\.py)
