Perl Diver 2.33
Main Environment Variables Perl Default Values Perl Config - Summary Perl Config - Full Installed Modules List Directory uptime Docs

Module Documentation
Details and documentation about a specific module, including version and documentation (if available). Note that while links to perldoc.com and search.cpan.org are provided, the module may be part of a larger distribution. If you reach a File Not Found page on either site, please try the parent module.

Regexp::Pattern::License

Name Regexp::Pattern::License
Version v3.9.3
Located at /usr/share/perl5
File /usr/share/perl5/Regexp/Pattern/License.pm
Is Core No
Search CPAN for this module Regexp::Pattern::License
Documentation Regexp::Pattern::License
Module Details Regexp::Pattern::License

NAME

Regexp::Pattern::License - Regular expressions for legal licenses


VERSION

Version v3.9.3


SYNOPSIS

    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!"


DESCRIPTION

the Regexp::Pattern::License manpage provides a hash of regular expression patterns related to legal software licenses.

the Regexp::Pattern manpage 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 .

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:*:* .

License combinations

Patterns each covering a combination of multiple licenses.

Each of these patterns has the tag type:combo .

License groups

Patterns each covering either of multiple licenses.

Each of these patterns has the tag type:group .


STRUCTURE

The regexp patterns follows the DefHash specification, and more specifically the structure of the Regexp::Pattern manpage, 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.

OBSOLETE OBJECTS

License objects obsoleted by improved coverage of other objects, and provided only as dummy objects.

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


EXAMPLES

Browse patterns

The ``official'' way to browse patterns is using the App::RegexpPatternUtils manpage:

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

Unfortunately, the App::RegexpPatternUtils manpage has a deep dependency tree. An alternative is to use the Data::Printer manpage 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-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/>.

Perl Diver brought to you by ScriptSolutions.com © 1997- 2026