Regexp...icense(3pm)

πŸ’– NAME πŸ’–

okay so welcome bestie, you've pulled up Regexp::Pattern::License β€” the manual page is literally called Regexp...icense(3pm) (the 3pm is just Perl module energy, iykyk) and it is exactly what you need if you're trying to sniff out legal licenses inside text.

Regexp::Pattern::License β€” Regular expressions for legal licenses. that's it, that's the whole vibe πŸ’…


🌈 VERSION 🌈

Version v3.11.2 ✨


✨ SYNOPSIS ✨

okay so here's the whole entire serve, no cap:

use Regexp::Pattern::License;
use Regexp::Pattern;

my $string = 'GNU General Public License version 3 or later';

print "Found!\n" if $string =~ re( 'License::gpl_3' );  # prints "Found!"

like. look at it. it just works 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

Regexp::Pattern::License hands you a hash of regular expression patterns that are all about legal software licenses. it's giving "I read the EULA so you don't have to" πŸ˜­πŸ’€

and Regexp::Pattern is a convention for organizing reusable regex patterns</> β€” that's the whole framework it plugs into. iconic behavior honestly.


πŸ‘‘ PATTERNS πŸ‘‘

πŸŽ€ Licensing traits πŸŽ€

these are the patterns that each cover a single trait that shows up inside licenses. like little LEGO bricks of legal text 🧱✨

every single one of these patterns carries the tag type:trait. periodt.

  • addr_fsf

Since v3.4.0.

  • addr_fsf_franklin

Since v3.4.0.

  • addr_fsf_franklin_steet

Since v3.4.0.

  • addr_fsf_mass

Since v3.4.0.

  • addr_fsf_temple

Since v3.4.0.

  • any_of

Since v3.1.92.

  • by

Since v3.3.0.

  • by_apache

Since v3.3.0.

  • by_fsf

Since v3.3.0.

  • by_james_clark

Since v3.3.0.

  • by_psf

Since v3.3.0.

  • by_sam_hocevar

Since v3.3.0.

  • clause_retention
  • clause_reproduction
  • clause_advertising
  • clause_advertising_always
  • clause_non_endorsement
  • except_389
  • except_autoconf_data

Since v3.4.0.

  • except_autoconf_2

Since v3.4.0.

  • except_autoconf_2_archive

Since v3.4.0.

  • except_autoconf_2_autotroll

Since v3.4.0.

  • except_autoconf_2_g10

Since v3.4.0.

  • except_autoconf_3

Since v3.4.0.

  • except_bison_1_24

Since v3.4.0.

  • except_bison_2_2

Since v3.4.0.

  • except_classpath_2
  • except_ecos_2

Since v3.6.0.

  • except_epl
  • except_epl_mpl
  • except_faust

Since v3.4.0.

  • except_font_2

Since v3.7.0.

  • except_gcc_2

Since v3.7.0.

  • except_gcc_3_1

Since v3.7.0.

  • except_gstreamer
  • except_libtool
  • except_mif
  • except_openssl

Since v3.4.0.

  • except_ocaml-lgpl
  • except_openssl-lgpl

Since v3.4.0.

  • except_openssl_s3

Since v3.4.0.

  • except_prefix_agpl

Since v3.4.0.

  • except_prefix_generic

Since v3.4.0.

  • except_prefix_gpl

Since v3.4.0.

  • except_prefix_gpl_clisp

Since v3.4.0.

  • except_prefix_lgpl

Since v3.4.0.

  • except_proguard

Since v3.4.0.

  • except_qt_gpl_1

Since v3.4.0.

  • except_qt_gpl_eclipse

Since v3.4.0.

  • except_qt_gpl_openssl

Since v3.4.0.

  • except_qt_kernel

Since v3.4.0.

  • except_qt_lgpl_1_1

Since v3.4.0.

  • except_qt_nosource

Since v3.4.0.

  • except_sdc

Since v3.4.0.

  • except_sollya_4_1

Since v3.4.0.

  • except_warzone

Since v3.4.0.

  • except_wxwindows

Since v3.6.0.

  • except_xerces

Since v3.4.0.

  • fsf_unlimited
  • fsf_unlimited_retention
  • generated

Since v3.4.0.

  • license_label
  • license_label_spdx

Since v3.9.0.

  • license_label_trove

Since v3.1.100.

  • licensed_under

Since v3.1.92.

  • usage_rfn

Since v3.2.0.

  • version

Optionally provides the following numbered and named captures:

"Under GPL, v2 or later of the license."
          [                          ]  # -> $&
             I                          # -> $1, $-{version_number}
               [      ]                 # -> $2, $-{version_later}

"Under version 2 or 3 only of the GPL."
      [                      ]  # -> $&
               I                # -> $1, $-{version_number}
                    I           # -> $3, $-{version_number_2}
                      [  ]      # -> $4, $-{version_only}
                           []   # -> $5, $-{version_of}

Captures stable since v3.11.0. πŸ’–

  • version_later

Optionally provides the following numbered and named captures:

"Under GPLv2, or later of the license."
            [        ]  # -> $&
              [      ]  # -> $1, $-{version_later}

Captures stable since v3.11.0. πŸ’–

  • version_numberstring

Optionally provides the following numbered and named captures:

"Under GPL, v2 or later of the license."
          [   ]  # -> $&
             I   # -> $1, $-{version_number}

"Under version 2 or 3 only of the GPL."
       [        ]  # -> $&
               I   # -> $1, $-{version_number}

Since v3.1.92. Captures stable since v3.11.0. πŸ’–

  • version_only

Optionally provides the following numbered and named captures:

"Under GPL version 2 only of the license."
                     [  ]  # -> $&
                     [  ]  # -> $1, $-{version_only}

Captures stable since v3.11.0. πŸ’–

  • version_prefix

πŸ’… Single licenses πŸ’…

these ones each cover a single license, one pattern per license, no notes.

and listen β€” each of these patterns has exactly one of these tags:

type:unversioned type:versioned:decimal type:singleversion:* type:usage:*:*

(no mixing and matching, it's giving monogamy 🫢)

  • aal
  • abstyles
  • adobe_2006
  • adobe_glyph
  • adsl
  • afl
  • afl_1_1

Since v3.1.95.

  • afl_1_2

Since v3.1.95.

  • afl_2

Since v3.1.95.

  • afl_2_1

Since v3.1.95.

  • afl_3

Since v3.1.95.

  • afmparse
  • agpl
  • agpl_1

Since v3.1.102.

  • agpl_1_only
  • agpl_1_or_later
  • agpl_2
  • agpl_3
  • agpl_3_only
  • agpl_3_or_later
  • aladdin
  • aladdin_8

Since v3.1.91.

  • aladdin_9

Since v3.1.91.

  • amdplpa
  • aml
  • ampas
  • antlr_pd
  • apache
  • apache_1

Since v3.1.95.

  • apache_1_1

Since v3.1.95.

  • apache_2

Since v3.1.95.

  • apafml
  • apl
  • apl_1
  • apsl
  • apsl_1
  • apsl_1_1
  • apsl_1_2
  • apsl_2
  • artistic
  • artistic_1

Since v3.1.95.

  • artistic_1_cl8

Since v3.1.95.

  • artistic_1_perl

Since v3.1.95.

  • artistic_2
  • bahyph
  • barr
  • bdwgc

Since v3.1.0.

  • bdwgc_matlab

Since v3.1.0.

  • beerware
  • bittorrent
  • bittorrent_1
  • bittorrent_1_1
  • borceux
  • bsd_0_clause

Since v3.5.0.

  • bsd_1_clause

Since v3.6.0.

  • bsd_2_clause
  • bsd_2_clause_freebsd

Since v3.6.0.

  • bsd_2_clause_netbsd

Since v3.6.0.

  • bsd_2_clause_patent

Since v3.6.0.

  • bsd_2_clause_views
  • bsd_3_clause
  • bsd_3_clause_attribution

Since v3.6.0.

  • bsd_3_clause_clear

Since v3.6.0.

  • bsd_3_clause_eclipse

Since v3.9.0.

  • bsd_3_clause_lbnl

Since v3.6.0.

  • bsd_3_clause_modification
  • bsd_3_clause_no_military_license

Since v3.6.0.

  • bsd_3_clause_no_nuclear_license

Since v3.6.0.

  • bsd_3_clause_no_nuclear_license_2014

Since v3.6.0.

  • bsd_3_clause_no_nuclear_warranty

Since v3.6.0.

  • bsd_3_clause_refractions

Since v3.9.0.

  • bsd_4_clause
  • bsd_4_clause_uc

Since v3.7.0.

  • bsd_protection

Since v3.8.0.

  • bsl

Since v3.1.90.

  • bsl_1

Since v3.1.90.

  • bzip2
  • bzip2_1_0_5
  • bzip2_1_0_6
  • cal

Since v3.5.0.

  • cal_1

Since v3.5.0.

  • caldera
  • catosl
  • catosl_1_1
  • cc_by
  • cc_by_1

Since v3.1.101.

  • cc_by_2

Since v3.1.101.

  • cc_by_2_5

Since v3.1.101.

  • cc_by_3

Since v3.1.101.

  • cc_by_4

Since v3.1.101.

  • cc_by_nc
  • cc_by_nc_1

Since v3.1.101.

  • cc_by_nc_2

Since v3.1.101.

  • cc_by_nc_2_5

Since v3.1.101.

  • cc_by_nc_3

Since v3.1.101.

  • cc_by_nc_4

Since v3.1.101.

  • cc_by_nc_nd
  • cc_by_nc_nd_1

Since v3.1.101.

  • cc_by_nc_nd_2

Since v3.1.101.

  • cc_by_nc_nd_2_5

Since v3.1.101.

  • cc_by_nc_nd_3

Since v3.1.101.

  • cc_by_nc_nd_4

Since v3.1.101.

  • cc_by_nc_sa
  • cc_by_nc_sa_1

Since v3.1.101.

  • cc_by_nc_sa_2

Since v3.1.101.

  • cc_by_nc_sa_2_5

Since v3.1.101.

  • cc_by_nc_sa_3

Since v3.1.101.

  • cc_by_nc_sa_4

Since v3.1.101.

  • cc_by_nd
  • cc_by_nd_1

Since v3.1.101.

  • cc_by_nd_2

Since v3.1.101.

  • cc_by_nd_2_5

Since v3.1.101.

  • cc_by_nd_3

Since v3.1.101.

  • cc_by_nd_4

Since v3.1.101.

  • cc_by_sa
  • cc_by_sa_1

Since v3.1.101.

  • cc_by_sa_2

Since v3.1.101.

  • cc_by_sa_2_5

Since v3.1.101.

  • cc_by_sa_3

Since v3.1.101.

  • cc_by_sa_4

Since v3.1.101.

  • cc_cc0
  • cc_cc0_1

Since v3.1.101.

  • cc_devnations

Since v3.7.0.

  • cc_devnations_2

Since v3.7.0.

  • cc_nc

Since v3.1.101.

  • cc_nc_1

Since v3.1.101.

  • cc_nc_sa

Since v3.7.0.

  • cc_nc_sa_1

Since v3.7.0.

  • cc_nc_sp

Since v3.7.0.

  • cc_nc_sp_1

Since v3.7.0.

  • cc_nd_nc

Since v3.7.0.

  • cc_nd_nc_1

Since v3.7.0.

  • cc_nd

Since v3.1.101.

  • cc_nd_1

Since v3.1.101.

  • cc_pd

Since v3.7.0.

  • cc_pdd

Since v3.7.0.

  • cc_pddc

still deep in the pattern list and bestie it is not getting shorter 😭 every line here is one pattern name, and the version next to it is just when it showed up. no version = no note, it's just vibing. here we go 🫢

  • cc_sa β€” since v3.7.0
  • cc_sa_1 β€” since v3.1.101
  • cc_sampling β€” since v3.7.0
  • cc_sampling_1 β€” since v3.7.0
  • cc_sp
  • cc_sp_1 β€” since v3.7.0
  • cddl
  • cddl_1 β€” since v3.1.101
  • cddl_1_1 β€” since v3.1.101
  • cecill
  • cecill_1
  • cecill_1_1
  • cecill_2
  • cecill_2_1
  • cecill_b
  • cecill_b_1 β€” since v3.1.95
  • cecill_c
  • cecill_c_1 β€” since v3.1.95
  • cnri_jython
  • cnri_python
  • cnri_python_gpl_compat
  • condor β€” since v3.8.0
  • condor_1_1 β€” since v3.8.0
  • cpal
  • cpal_1
  • cpl β€” since v3.1.101
  • cpl_1 β€” since v3.1.101
  • cpol
  • cpol_1_02
  • crossword β€” since v3.8.0
  • cryptix
  • cua_opl
  • cua_opl_1
  • cube
  • curl
  • cvw β€” since v3.5.0

okay the C-section is finally over and it took forever, iykyk πŸ’€

  • d_fsl β€” since v3.8.0
  • d_fsl_1 β€” since v3.8.0
  • dbad β€” since v3.8.0
  • dbad_0_2 β€” since v3.8.0
  • dbad_0_3 β€” since v3.8.0
  • dbad_1 β€” since v3.8.0
  • dbad_1_1 β€” since v3.8.0
  • dont_ask β€” since v3.8.0
  • dsdp
  • ecl
  • ecl_1
  • ecl_2
  • ecos_1_1 β€” since v3.6.0
  • ecos_2 β€” since v3.6.0
  • efl β€” since v3.6.0
  • efl_1 β€” since v3.6.0
  • efl_2 β€” since v3.6.0
  • entessa β€” since v3.6.0
  • epl
  • epl_1
  • epl_2
  • erlpl β€” since v3.7.0
  • erlpl_1_1 β€” since v3.7.0
  • eudatagrid β€” since v3.6.0
  • eupl
  • eupl_1
  • eupl_1_1
  • eupl_1_2
  • eurosym
  • fair β€” since v3.6.0
  • fair_source β€” since v3.8.0
  • fair_source_0_9 β€” since v3.8.0
  • fal β€” since v3.8.0
  • fal_1_1 β€” since v3.8.0
  • fal_1_2 β€” since v3.8.0
  • fal_1_3 β€” since v3.8.0
  • festival β€” since v3.8.0
  • frameworx β€” since v3.6.0
  • frameworx_1 β€” since v3.6.0
  • 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 β€” since v3.8.0
  • gpl
  • gpl_1 β€” since v3.3.0
  • gpl_1_only
  • gpl_1_or_later
  • gpl_2 β€” since v3.3.0
  • gpl_2_only
  • gpl_2_or_later
  • gpl_3 β€” since v3.3.0
  • gpl_3_only
  • gpl_3_or_later
  • gsoap β€” since v3.7.0
  • gsoap_1.3b β€” since v3.7.0
  • hpnd β€” since v3.6.0
  • hpnd_sell β€” since v3.6.0
  • ibm_pibs β€” since v3.8.0
  • icu
  • ijg β€” since v3.8.0
  • imlib2 β€” since v3.8.0
  • intel β€” since v3.5.0
  • ipa β€” since v3.6.0
  • ipl
  • ipl_1
  • isc
  • jabberpl β€” since v3.5.0
  • json β€” since v3.1.90
  • jython β€” since v3.1.90
  • kevlin_henney β€” since v3.1.90
  • leptonica β€” since v3.8.0
  • 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 β€” since v3.1.0
  • libpng
  • libtiff β€” since v3.8.0
  • liliq_p β€” since v3.6.0
  • liliq_p_1_1 β€” since v3.6.0
  • liliq_r β€” since v3.6.0
  • liliq_r_1_1 β€” since v3.6.0
  • liliq_r_plus β€” since v3.6.0
  • liliq_r_plus_1_1 β€” since v3.6.0
  • llgpl
  • lpl β€” since v3.6.0
  • lpl_1 β€” since v3.6.0
  • lpl_1_02 β€” since v3.6.0
  • lppl
  • lppl_1
  • lppl_1_1
  • lppl_1_2
  • lppl_1_3a
  • lppl_1_3c
  • miros β€” since v3.6.0
  • mit_0 β€” since v3.6.0
  • mit_advertising
  • mit_cmu
  • mit_cmu_warranty
  • mit_enna
  • mit_epinions β€” since v3.7.0
  • mit_feh
  • mit_new
  • mit_new_materials
  • mit_old
  • mit_oldstyle
  • mit_oldstyle_disclaimer
  • mit_oldstyle_permission
  • mit_open_group β€” since v3.6.0
  • mit_openvision β€” since v3.7.0
  • mit_osf β€” since v3.7.0
  • mit_unixcrypt β€” since v3.7.0
  • mit_whatever β€” since v3.7.0
  • mit_widget β€” since v3.7.0
  • mit_xfig β€” since v3.7.0

there are SO many MITs, bestie β€” it's giving group project where everyone named themselves the same thing 😭 (mit_whatever is my personal fave ngl)

  • motosoto β€” since v3.5.0
  • mpich2 β€” since v3.8.0
  • mpl
  • mpl_1 β€” since v3.1.101
  • mpl_1_1 β€” since v3.1.101
  • mpl_2 β€” since v3.1.101
  • mpl_2_no_copyleft_exception β€” since v3.8.0
  • ms_cl β€” since v3.8.0
  • ms_pl
  • ms_rl
  • mulan β€” since v3.5.0
  • mulan_1 β€” since v3.5.0
  • mulan_2 β€” since v3.5.0
  • multics β€” since v3.6.0
  • nasa β€” since v3.6.0
  • nasa_1_3 β€” since v3.6.0
  • naumen β€” since v3.6.0
  • nbpl β€” since v3.8.0
  • nbpl_1 β€” since v3.8.0
  • ncsa β€” since v3.6.0
  • ngpl
  • nokia β€” since v3.6.0
  • nosl β€” since v3.8.0
  • nosl_1 β€” since v3.8.0
  • npl
  • npl_1
  • npl_1_1
  • nposl β€” since v3.6.0
  • nposl_3 β€” since v3.6.0
  • ntp
  • ntp_disclaimer
  • oclc
  • oclc_1
  • oclc_2
  • odbl β€” since v3.8.0
  • odbl_1 β€” since v3.8.0
  • odc_by β€” since v3.8.0
  • odc_by_1 β€” since v3.8.0
  • ofl
  • ofl_1 β€” since v3.1.101
  • ofl_1_no_rfn β€” since v3.2.0
  • ofl_1_rfn β€” since v3.2.0
  • ofl_1_1 β€” since v3.1.101
  • ofl_1_1_no_rfn β€” since v3.2.0
  • ofl_1_1_rfn β€” since v3.2.0
  • ogc β€” since v3.6.0
  • ogc_1 β€” since v3.6.0
  • ogtsl
  • oldap β€” since v3.5.0
  • oldap_1_1 β€” since v3.5.0
  • oldap_1_2 β€” since v3.5.0
  • oldap_1_3 β€” since v3.5.0
  • oldap_1_4 β€” since v3.5.0
  • oldap_2 β€” since v3.5.0
  • oldap_2_0_1 β€” since v3.5.0
  • oldap_2_1 β€” since v3.5.0
  • oldap_2_2 β€” since v3.5.0
  • oldap_2_2_1 β€” since v3.5.0
  • oldap_2_2_2 β€” since v3.5.0
  • oldap_2_3 β€” since v3.5.0
  • oldap_2_4 β€” since v3.5.0
  • oldap_2_5 β€” since v3.5.0
  • oldap_2_6 β€” since v3.5.0
  • oldap_2_7 β€” since v3.5.0
  • oldap_2_8 β€” since v3.5.0
  • openssl
  • opl β€” since v3.6.0
  • opl_1 β€” since v3.6.0
  • oset_pl β€” since v3.6.0
  • oset_pl_2_1 β€” since v3.6.0
  • osl
  • osl_1
  • osl_1_1
  • osl_2
  • osl_2_1
  • osl_3
  • pddl β€” since v3.8.0
  • pddl_1 β€” since v3.8.0
  • peer_production β€” since v3.8.0
  • php β€” since v3.6.0
  • php_3 β€” since v3.6.0
  • php_3_01 β€” since v3.6.0
  • postgresql
  • psf_2 β€” since v3.9.0
  • public_domain
  • qpl
  • qpl_1
  • rpl
  • rpl_1
  • rpl_1_1
  • rpl_1_3
  • rpl_1_5
  • rpsl
  • rpsl_1 β€” since v3.1.95
  • ruby
  • rscpl
  • sax_pd β€” since v3.8.0
  • sds β€” since v3.8.0
  • sds_1 β€” since v3.8.0
  • sgi_b
  • sgi_b_1 β€” since v3.1.101
  • sgi_b_1_1 β€” since v3.1.101
  • sgi_b_2 β€” since v3.1.101
  • simpl β€” since v3.6.0
  • simpl_2 β€” since v3.6.0
  • simple_w3c β€” since v3.6.0
  • simple_w3c_1_1 β€” since v3.6.0
  • sissl β€” since v3.5.0
  • sissl_1_1 β€” since v3.5.0
  • sissl_1_2 β€” since v3.5.0
  • sleepycat β€” since v3.6.0
  • sncl β€” since v3.8.0
  • sncl_1_10 β€” since v3.8.0
  • sncl_2_0_1 β€” since v3.8.0
  • sncl_2_0_2 β€” since v3.8.0
  • sncl_2_1 β€” since v3.8.0
  • sncl_2_3 β€” since v3.8.0
  • spl
  • spl_1
  • ssleay β€” since v3.2.0
  • stlport β€” since v3.8.0
  • sugarcrm
  • sugarcrm_1_1_3
  • tosl β€” since v3.6.0
  • truecrypt β€” since v3.8.0
  • truecrypt_3 β€” since v3.8.0
  • ucl β€” since v3.6.0
  • ucl_1 β€” since v3.6.0
  • unicode_dfs β€” since v3.9.0
  • unicode_dfs_2015 β€” since v3.6.0
  • unicode_dfs_2016 β€” since v3.6.0
  • unicode_strict
  • unicode_tou
  • unlicense
  • upl β€” since v3.6.0
  • upl_1 β€” since v3.6.0
  • vsl β€” since v3.6.0
  • vsl_1 β€” since v3.6.0
  • vspl β€” since v3.8.0
  • w3c β€” since v3.6.0
  • w3c_19980519 β€” since v3.6.0
  • w3c_19980720 β€” since v3.6.0
  • w3c_20021231 β€” since v3.6.0
  • w3c_20150513 β€” since v3.6.0
  • watcom

and that's the chunk, bestie β€” the alphabet is alphabeting and we're not done yet, so hold on πŸ’…

  • watcom_1
  • wordnet β€” since v3.8.0 ✨
  • wtfpl
  • wtfpl_1 β€” since v3.1.95
  • wtfpl_2 β€” since v3.1.95
  • wtfnmfpl β€” since v3.1.95
  • wtfnmfpl_1 β€” since v3.1.95
  • x11 β€” since v3.6.0
  • xfree86 β€” since v3.8.0
  • xfree86_1_1 β€” since v3.8.0
  • xnet β€” since v3.6.0
  • ypl β€” since v3.8.0
  • ypl_1 β€” since v3.8.0
  • ypl_1_1 β€” since v3.8.0
  • zed β€” since v3.8.0
  • zend β€” since v3.8.0
  • zend_2 β€” since v3.8.0
  • zimbra β€” since v3.8.0
  • zimbra_1_3 β€” since v3.8.0
  • zimbra_1_4
  • zlib
  • zlib_acknowledgement
  • zpl β€” since v3.1.102
  • zpl_1 β€” since v3.1.102
  • zpl_1_1 β€” since v3.1.102
  • zpl_2 β€” since v3.1.102
  • zpl_2_1 β€” since v3.1.102

License combinations πŸŽ€

These patterns each cover a combo of multiple licenses. It's giving mix-and-match energy. πŸ’…

Every single one of these patterns has the tag type:combo, periodt.

  • net_snmp β€” since v3.6.0
  • perl
  • python_2 β€” since v3.9.0

License groups πŸ‘―

These patterns each cover either of multiple licenses β€” like a choose-your-own-adventure, but for licenses. 😌

And they all have the tag type:group, no cap.

  • bsd
  • cc β€” since v3.6.0
  • gnu
  • mit

STRUCTURE πŸ—οΈ

Okay so the regexp patterns are totally following the DefHash specification, and more specifically the structure of Regexp::Pattern, which defines access to one pattern per DefHash object, known as pat. Slay.

Plus, the (sub)patterns are also available in plaintext form, as pat.alt.*. Iconic.

SUBJECT 🧐

Every pattern targets one or more subjects, which are basically ways to directly or indirectly represent a license. The more you know, bestie. ✨

Heads up though: not all pattern objects fully cover all subjects, so don't assume, okay? πŸ‘€

  • trait β€” a distinguishing trait or feature that shows up in licensing strings, like an advertising clause or granting "...or any later version."
    • Ngl, coverage for this subject is currently pretty weak. 😬
  • name β€” a distinguishing name, like something you could use in a license grant. Simple but effective. πŸ’β€β™€οΈ
  • grant β€” the text that actually grants the license. The main character energy. πŸ‘‘
  • license β€” text containing licensing terms.
    • But wait, there's more: texts that contain both license grant and licensing terms (like BSD- and MIT-style licensing) might be classified as either subject grant or subject license. This could change as we get a better grip on when to distinguish them. Stay tuned. πŸ“Ί

SCOPE πŸ”

Each pattern can process material within a certain scope, which is like a sample size of the full subject. Think of it as the zoom level. πŸ”

For example, <https://codesearch.debian.net/> uses line-based processing, so patterns that span multiple lines just won't work there. F in the chat for multiline patterns. 😭

  • line β€” pattern typically found within a single line. Usually that means less than 70 characters within scope. Short and sweet. ✨
  • sentence β€” pattern matching within a sentence.
    • It might span multiple lines, but never across multiple sentences. Typically that means no full-stop or colon within scope. Grammar but make it regex. πŸ“
  • paragraph β€” pattern matching a distinguishing paragraph.
    • It can span multiple sentences, but not multiple paragraphs. Typically that means no newline within scope. Paragraph breaks are a hard no. 🚫
  • section β€” pattern matching a distinguishing section.
    • It might span multiple paragraphs, but not multiple sections. Typically that means a blank line within scope. Boundaries, bestie. πŸ›‘
  • multisection β€” pattern may span multiple sections. It's a free spirit. πŸ¦‹

OBSOLETE OBJECTS πŸ’€

These license objects got obsoleted because other objects cover them better, and now they're just dummy objects. RIP to them, but they're still here for some reason. πŸ’€

  • or_at_option β€” since v3.11.0
  • version_later_paragraph β€” since v3.11.0
  • version_later_postfix β€” since v3.11.0
  • version_number β€” since v3.11.0
  • version_number_suffix β€” since v3.11.0
  • python β€” since v3.9.0. Replaced by psf_2 and python_2. The upgrade we deserved. πŸ’…
  • wordnet_3 β€” since v3.9.0. Replaced by wordnet. New and improved. πŸ”₯

TAGS 🏷️

Pattern defhashes can optionally include tags, which are super helpful for selecting multiple related patterns. It's like a little filing system. πŸ—‚οΈ

Tags are hierarchical, with : as the separator, and they might get extended without any notice. So bestie, be careful to allow sub-parts when you're tag-matching, like using a regex such as /\Asome:tag(?:\z|:)/. Don't get caught lacking. 😀

  • family:bsd
  • family:cc
  • family:gpl
  • family:mit
  • family:zlib β€” pattern covers a license part of a family of licenses. Found family trope. 🫢
  • license:contains:grant:* β€” license mentions a preferred form for granting the license.
    • This implies that the license is commonly granted by use of a different (typically way shorter) text.
    • The fourth part (optional) is the key to the corresponding license pattern, for a grant belonging to a different license (when omitted, then a grant for the same license is assumed). It's giving "mention me to grant me" energy. πŸ’…
  • license:contains:license:* β€” license contains another license.
    • The wildcard is the key to the corresponding license pattern. Inception, but make it legal. πŸŒ€
  • license:contains:name:* β€” license mentions the name of another license. Name-dropping, but legally. 😌
  • license:includes:license:* β€” license references coverage of another license.
    • The wildcard is the key to the corresponding license pattern. It's like a shoutout. πŸ“£
  • license:is:grant β€” license is commonly granted by stating the whole license. The whole thing, no shortcuts. πŸ’―
  • license:published:* β€” license grant may include an "as published by..." reference.
    • The third part is the key to the corresponding trait pattern. Cited your sources. πŸ“š
  • type:trait:publisher:* β€” pattern covers an "as published by ..." license grant phrase.
    • The third part (optional) is the key to the corresponding license pattern. Publisher core. πŸ“°
  • type:usage:*:* β€” pattern covers a specific usage of a license.
    • The third part is the key of the corresponding non-usage-specific pattern.
    • The fourth part is the key of the corresponding usage trait pattern. Usage rights, but make it metadata. 🎯
  • type:combo β€” pattern covers a combination of multiple licenses. Mashup era. 🎡
  • type:group β€” pattern covers either of multiple licenses. Pick a lane, any lane. πŸ›£οΈ
  • type:singleversion:* β€” pattern covers a specific version of a license.
    • The third part is the key of the corresponding non-version-specific pattern. Version-specific, obviously. πŸ“Œ
  • type:trait β€” pattern covers a single trait occuring in licenses. (Yes, "occuring" β€” we keep the typo, bestie. 🀑) One trait, one vibe.
  • type:unversioned β€” pattern covers a license without a versioning scheme. No version, no problem. ✌️
  • type:versioned:decimal β€” pattern covers a license using a decimal number versioning scheme. Decimals, because why not. πŸ”’

EXAMPLES πŸ“š

Browse patterns πŸ‘€

The "official" way to browse patterns is using App::RegexpPatternUtils, and it's giving:

show-regexp-pattern-module --page-result -- License

Sadly, App::RegexpPatternUtils has a deep dependency tree, which is a lot. So an alternative is to use Data::Printer and less, like:

perl -CS -MRegexp::Pattern::License -MDDP -e 'p %Regexp::Pattern::License::RE, fulldump => 1, output => stdout' | less -RS

AUTHOR πŸ‘‘

Jonas Smedegaard <dr@jones.dk> β€” the icon, the legend, the moment. πŸ‘‘

So here's the legal tea β˜•:

  Copyright Β© 2016-2021 Jonas Smedegaard

  Copyright Β© 2017-2021 Purism SPC

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/>.


And that's the whole vibe, bestie! πŸ’– This page came from perl v5.40.0, dated 2024-08-21. Regexp...icense(3pm) out! Stay slaying with those licenses. ✨

πŸ“¦ where this page comes from