Regexp::Pattern::Example(3pm) | User Contributed Perl Documentation | Regexp::Pattern::Example(3pm) |
Regexp::Pattern::Example - An example Regexp::Pattern::* module
This document describes version 0.2.14 of Regexp::Pattern::Example (from Perl distribution Regexp-Pattern), released on 2020-04-01.
use Regexp::Pattern; # exports re() my $re = re("Example::re1");
Regexp::Pattern is a convention for organizing reusable regex patterns.
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
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:
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
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
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
Please visit the project's homepage at <https://metacpan.org/release/Regexp-Pattern>.
Source repository is at <https://github.com/perlancar/perl-Regexp-Pattern>.
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.
perlancar <perlancar@cpan.org>
This software is copyright (c) 2020, 2019, 2018, 2016 by perlancar@cpan.org.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
2022-11-29 | perl v5.36.0 |