Regexp::Pattern::Example(3pm)

Regexp::Pattern::Example3pm

An example regexp::pattern::* module

Usage

 use Regexp::Pattern; # exports re()
 my $re = re("Example::re1");

Version

This document describes version 0.2.14 of Regexp::Pattern::Example (from Perl distribution Regexp-Pattern), released on 2020-04-01.

Overview

Regexp::Pattern is a convention for organizing reusable regex patterns.

Patterns

•

re1

•

re2

This is regexp for blah.

A longer description in Markdown format.

Examples:

 "123-456" =~ re("Example::re2");  # matches

Another example that matches.

 "123-456-78901" =~ re("Example::re2");  # matches

An example that does not match.

 123456 =~ re("Example::re2");  # doesn't match

An example that does not get tested.

 123456 =~ re("Example::re2");  # doesn't match
•

re3

This is a regexp for blah blah.

...

This is a dynamic pattern which will be generated on-demand.

The following arguments are available to customize the generated pattern:

•

variant

Choose variant.

Examples:

An example that matches.

 "123-456" =~ re("Example::re3", {variant=>"A"});  # matches

An example that doesn't match.

 "123-456" =~ re("Example::re3", {variant=>"B"});  # doesn't match
•

re4

This is a regexp that does capturing.

Examples:

 "123-456" =~ re("Example::re4"); # matches, $1=123, $2=456
 "foo-bar" =~ re("Example::re4");  # doesn't match
•

re5

This is another regexp that is anchored and does (named) capturing.

Examples:

 "123-456" =~ re("Example::re5"); # matches, $+{"cap1"}=123, $+{"cap2"}=456
 "something 123-456" =~ re("Example::re5");  # doesn't match

Homepage

Please visit the project's homepage at <https://metacpan.org/release/Regexp-Pattern>.

Source

Source repository is at <https://github.com/perlancar/perl-Regexp-Pattern>.

Releases

4 releases since Debian 10 (Buster); the text changed 2 times.

  1. 10
  2. 11
  3. 12–13

Bugs

Please report any bugs or feature requests on the bugtracker website <https://rt.cpan.org/Public/Dist/Display.html?Name=Regexp-Pattern>

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

Author

perlancar <[email protected]>

From libregexp-pattern-perl 0.2.14-2 in Debian 13 (Trixie). Parsed by carta from the page's man source.