NAME
Regexp::Pattern::License - Regular expressions for legal licenses
VERSION
Version v3.8.0
SYNOPSIS
use Regexp::Pattern::License;
use Regexp::Pattern;
my $re = re( 'License::gpl_3' );
my $string = 'GNU General Public License version 3 or later';
$string =~ /$re/; # => success
DESCRIPTION
Regexp::Pattern::License provides a hash of regular expression patterns related to legal software licenses.
Regexp::Pattern is a convention for organizing reusable regex patterns.
PATTERNS
Licensing traits
Patterns each covering a single trait occuring in licenses.
Each of these patterns has the tag type:trait .
addr_fsf
addr_fsf_franklin
addr_fsf_franklin_steet
addr_fsf_mass
addr_fsf_temple
any_of
by
by_apache
by_fsf
by_james_clark
by_psf
by_sam_hocevar
clause_retention
clause_reproduction
clause_advertising
clause_advertising_always
clause_non_endorsement
except_389
except_autoconf_data
except_autoconf_2
except_autoconf_2_archive
except_autoconf_2_autotroll
except_autoconf_2_g10
except_autoconf_3
except_bison_1_24
except_bison_2_2
except_classpath_2
except_ecos_2
except_epl
except_epl_mpl
except_faust
except_font_2
except_gcc_2
except_gcc_3_1
except_gstreamer
except_libtool
except_mif
except_openssl
except_ocaml-lgpl
except_openssl-lgpl
except_openssl_s3
except_prefix_agpl
except_prefix_generic
except_prefix_gpl
except_prefix_gpl_clisp
except_prefix_lgpl
except_proguard
except_qt_gpl_1
except_qt_gpl_eclipse
except_qt_gpl_openssl
except_qt_kernel
except_qt_lgpl_1_1
except_qt_nosource
except_sdc
except_sollya_4_1
except_warzone
except_wxwindows
except_xerces
fsf_unlimited
fsf_unlimited_retention
generated
license_label
license_label_trove
licensed_under
or_at_option
usage_rfn
version
version_later
version_later_paragraph
version_later_postfix
version_number
version_number_suffix
version_only
version_prefix
version_numberstring
Single licenses
Patterns each covering a single license.
Each of these patterns has exactly one of these tags: type:unversioned type:versioned:decimal type:singleversion:* type:usage:*:* .
aal
abstyles
adobe_2006
adobe_glyph
adsl
afl
afl_1_1
afl_1_2
afl_2
afl_2_1
afl_3
afmparse
agpl
agpl_1
agpl_1_only
agpl_1_or_later
agpl_2
agpl_3
agpl_3_only
agpl_3_or_later
aladdin
aladdin_8
aladdin_9
amdplpa
aml
ampas
antlr_pd
apache
apache_1
apache_1_1
apache_2
apafml
apl
apl_1
apsl
apsl_1
apsl_1_1
apsl_1_2
apsl_2
artistic
artistic_1
artistic_1_cl8
artistic_1_perl
artistic_2
bahyph
barr
bdwgc
bdwgc_matlab
beerware
bittorrent
bittorrent_1
bittorrent_1_1
borceux
bsd_0_clause
bsd_1_clause
bsd_2_clause
bsd_2_clause_freebsd
bsd_2_clause_netbsd
bsd_2_clause_patent
bsd_2_clause_views
bsd_3_clause
bsd_3_clause_attribution
bsd_3_clause_clear
bsd_3_clause_lbnl
bsd_3_clause_modification
bsd_3_clause_no_military_license
bsd_3_clause_no_nuclear_license
bsd_3_clause_no_nuclear_license_2014
bsd_3_clause_no_nuclear_warranty
bsd_4_clause
bsd_4_clause_uc
bsd_protection
bsl
bsl_1
bzip2
bzip2_1_0_5
bzip2_1_0_6
cal
cal_1
caldera
catosl
catosl_1_1
cc_by
cc_by_1
cc_by_2
cc_by_2_5
cc_by_3
cc_by_4
cc_by_nc
cc_by_nc_1
cc_by_nc_2
cc_by_nc_2_5
cc_by_nc_3
cc_by_nc_4
cc_by_nc_nd
cc_by_nc_nd_1
cc_by_nc_nd_2
cc_by_nc_nd_2_5
cc_by_nc_nd_3
cc_by_nc_nd_4
cc_by_nc_sa
cc_by_nc_sa_1
cc_by_nc_sa_2
cc_by_nc_sa_2_5
cc_by_nc_sa_3
cc_by_nc_sa_4
cc_by_nd
cc_by_nd_1
cc_by_nd_2
cc_by_nd_2_5
cc_by_nd_3
cc_by_nd_4
cc_by_sa
cc_by_sa_1
cc_by_sa_2
cc_by_sa_2_5
cc_by_sa_3
cc_by_sa_4
cc_cc0
cc_cc0_1
cc_devnations
cc_devnations_2
cc_nc
cc_nc_1
cc_nc_sa
cc_nc_sa_1
cc_nc_sp
cc_nc_sp_1
cc_nd_nc
cc_nd_nc_1
cc_nd
cc_nd_1
cc_pd
cc_pdd
cc_pddc
cc_sa
cc_sa_1
cc_sampling
cc_sampling_1
cc_sp
cc_sp_1
cddl
cddl_1
cddl_1_1
cecill
cecill_1
cecill_1_1
cecill_2
cecill_2_1
cecill_b
cecill_b_1
cecill_c
cecill_c_1
cnri_jython
cnri_python
cnri_python_gpl_compat
condor
condor_1_1
cpal
cpal_1
cpl
cpl_1
cpol
cpol_1_02
crossword
cryptix
cua_opl
cua_opl_1
cube
curl
cvw
d_fsd
d_fsd_1
dbad
dbad_0_2
dbad_0_3
dbad_1
dbad_1_1
dont_ask
dsdp
ecl
ecl_1
ecl_2
ecos_1_1
ecos_2
efl
efl_1
efl_2
entessa
epl
epl_1
epl_2
erlpl
erlpl_1_1
eudatagrid
eupl
eupl_1
eupl_1_1
eupl_1_2
eurosym
fair
fair_source
fair_source_0_9
fal
fal_1_1
fal_1_2
fal_1_3
festival
frameworx
frameworx_1
fsfap
fsful
fsfullr
ftl
gfdl
gfdl_1_1
gfdl_1_1_only
gfdl_1_1_or_later
gfdl_1_2
gfdl_1_2_only
gfdl_1_2_or_later
gfdl_1_3
gfdl_1_3_only
gfdl_1_3_or_later
gfdl_niv
glide
gpl
gpl_1
gpl_1_only
gpl_1_or_later
gpl_2
gpl_2_only
gpl_2_or_later
gpl_3
gpl_3_only
gpl_3_or_later
gsoap
gsoap_1.3b
hpnd
hpnd_sell
ibm_pibs
icu
ijg
imlib2
intel
ipa
ipl
ipl_1
isc
jabberpl
json
jython
kevlin_henney
leptonica
lgpl
lgpl_2
lgpl_2_only
lgpl_2_or_later
lgpl_2_1
lgpl_2_1_only
lgpl_2_1_or_later
lgpl_3
lgpl_3_only
lgpl_3_or_later
lgpl_bdwgc
libpng
libtiff
liliq_p
liliq_p_1_1
liliq_r
liliq_r_1_1
liliq_r_plus
liliq_r_plus_1_1
llgpl
lpl
lpl_1
lpl_1_02
lppl
lppl_1
lppl_1_1
lppl_1_2
lppl_1_3a
lppl_1_3c
miros
mit_0
mit_advertising
mit_cmu
mit_cmu_warranty
mit_enna
mit_epinions
mit_feh
mit_new
mit_new_materials
mit_old
mit_oldstyle
mit_oldstyle_disclaimer
mit_oldstyle_permission
mit_open_group
mit_openvision
mit_osf
mit_unixcrypt
mit_whatever
mit_widget
mit_xfig
motosoto
mpich2
mpl
mpl_1
mpl_1_1
mpl_2
ms_cl
ms_pl
ms_rl
mulan
mulan_1
mulan_2
multics
nasa
nasa_1_3
naumen
nbpl
nbpl_1
ncsa
ngpl
nokia
nosl
nosl_1
npl
npl_1
npl_1_1
nposl
nposl_3
ntp
ntp_disclaimer
oclc
oclc_1
oclc_2
odbl
odbl_1
odc_by
odc_by_1
ofl
ofl_1
ofl_1_no_rfn
ofl_1_rfn
ofl_1_1
ofl_1_1_no_rfn
ofl_1_1_rfn
ogc
ogc_1
ogtsl
oldap
oldap_1_1
oldap_1_2
oldap_1_3
oldap_1_4
oldap_2
oldap_2_0_1
oldap_2_1
oldap_2_2
oldap_2_2_1
oldap_2_2_2
oldap_2_3
oldap_2_4
oldap_2_5
oldap_2_6
oldap_2_7
oldap_2_8
openssl
opl
opl_1
oset_pl
oset_pl_2_1
osl
osl_1
osl_1_1
osl_2
osl_2_1
osl_3
pddl
pddl_1
peer_production
php
php_3
php_3_01
postgresql
public_domain
python
python_2
qpl
qpl_1
rpl
rpl_1
rpl_1_1
rpl_1_3
rpl_1_5
rpsl
rpsl_1
ruby
rscpl
sax_pd
sds
sds_1
sgi_b
sgi_b_1
sgi_b_1_1
sgi_b_2
simpl
simpl_2
simple
simple_1_1
sissl
sissl_1_1
sissl_1_2
sleepycat
sncl
sncl_1_10
sncl_2_0_1
sncl_2_0_2
sncl_2_1
sncl_2_3
spl
spl_1
ssleay
stlport
sugarcrm
sugarcrm_1_1_3
tosl
truecrypt
truecrypt_3
ucl
ucl_1
unicode_dfs_2015
unicode_dfs_2016
unicode_strict
unicode_tou
unlicense
upl
upl_1
vsl
vsl_1
vspl
w3c
w3c_19980519
w3c_19980720
w3c_20021231
w3c_20150513
watcom
watcom_1
wordnet
wordnet_3
wtfpl
wtfpl_1
wtfpl_2
wtfnmfpl
wtfnmfpl_1
x11
xfree86
xfree86_1_1
xnet
ypl
ypl_1
ypl_1_1
zed
zend
zend_2
zimbra
zimbra_1_3
zimbra_1_4
zlib
zlib_acknowledgement
zpl
zpl_1
zpl_1_1
zpl_2
zpl_2_1
License combinations
Patterns each covering a combination of multiple licenses.
Each of these patterns has the tag type:combo .
net_snmp
perl
License groups
Patterns each covering either of multiple licenses.
Each of these patterns has the tag type:group .
bsd
cc
gnu
mit
STRUCTURE
The regexp patterns follows the DefHash specification, and more specifically the structure of Regexp::Pattern, defining access to one pattern per DefHash object, as pat
.
Additionally, (sub)patterns are available in plaintext form, as pat.alt.*
.
SUBJECT
Each pattern targets one or more subjects, i.e. ways to directly or indirectly represent a license.
Beware that not all pattern objects fully cover all subjects.
- trait
-
Distinguishing trait or feature expressed in licensing strings, e.g. an advertising clause or granting "...or any later version."
Coverage for this subject is currently rather weak.
- name
-
Distinguishing name, e.g. usable in license grant.
- grant
-
Text granting the license.
- license
-
Text containing licensing terms.
Texts containing both license grant and licensing terms (e.g. BSD- and MIT-style licensing) may be classified as either subject grant or subject license. This may change, as needs for distinction is better understood.
SCOPE
Each pattern can process material within some scope, i.e. a certain sample size of the full subject.
As an example, https://codesearch.debian.net/ use line-based processing, where patterns spanning multiple lines are not applicable.
- line
-
Pattern typically found within a single line. Typically this means less than 70 characters within scope.
- sentence
-
Pattern matching within a sentence.
May span multiple lines, but not across multiple sentences. Typically this means no full-stop or colon within scope.
- paragraph
-
Pattern matching distinguishing paragraph.
May span multiple sentences, but not multiple paragraphs. Typically this means no newline within scope.
- section
-
Pattern matching distinguishing section.
May span multiple paragraphs, but not multiple sections. Typically this means blank line within scope.
- multisection
-
Pattern may span multiple sections.
TAGS
Pattern defhashes optionally includes tags, which may help in selecting multiple related patterns.
Tags are hierarchical, with :
as separator, and may be extended without notice. Therefore take care to permit sub-parts when tag-matching, e.g. using a regex like /\Asome:tag(?:\z|:)/
.
family:bsd
family:cc
family:gpl
family:mit
family:zlib
Pattern covers a license part of a family of licenses.
license:contains:grant:*
License mentions a preferred form for granting the license.
This implies that license is commonly granted by use of a different (typically far shorter) text.
Fourth part (optional) is the key to corresponding license pattern, for a grant belonging to a different license (when omitted then a grant for same license is assumed).
license:contains:license:*
License contains another license.
Wildcard is the key to corresponding license pattern.
license:contains:name:*
License mentions name of another license.
license:includes:license:*
License references coverage of another license.
Wildcard is the key to corresponding license pattern.
license:is:grant
License is commonly granted by stating the whole license.
license:published:*
License grant may include an "as published by..." reference.
Third part is the key to corresponding trait pattern.
type:trait:publisher:*
Pattern covers an "as published by ..." license grant phrase.
Third part (optional) is the key to corresponding license pattern.
type:usage:*:*
Pattern covers a specific usage of a license.
Third part is the key of the corresponding non-usage-specific pattern.
Fourth part is the key of the corresponding usage trait pattern.
type:combo
Pattern covers a combination of multiple licenses.
type:group
Pattern covers either of multiple licenses.
type:singleversion:*
Pattern covers a specific version of a license.
Third part is the key of the corresponding non-version-specific pattern.
type:trait
Pattern covers a single trait occuring in licenses.
type:unversioned
Pattern covers a license without versioning scheme.
type:versioned:decimal
Pattern covers a license using decimal number versioning scheme.
EXAMPLES
Browse patterns
The "official" way to browse patterns is using App::RegexpPatternUtils:
show-regexp-pattern-module --page-result -- License
Unfortunately, App::RegexpPatternUtils has a deep dependency tree. An alternative is to use Data::Printer and less
:
perl -CS -MRegexp::Pattern::License -MDDP -e 'p %Regexp::Pattern::License::RE, fulldump => 1, output => stdout' | less -RS
AUTHOR
Jonas Smedegaard <dr@jones.dk>
COPYRIGHT AND LICENSE
Copyright © 2016-2017 Jonas Smedegaard
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.