Skip Menu |

This queue is for tickets about the Regexp-Common CPAN distribution.

Report information
The Basics
Id: 129566
Status: new
Priority: 0/
Queue: Regexp-Common

People
Owner: Nobody in particular
Requestors: jim.avera [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Examples in pod do not work(?) Regexp::Common
Date: Mon, 13 May 2019 14:40:10 -0700
To: bug-Regexp-Common [...] rt.cpan.org
From: Jim Avera <jim.avera [...] gmail.com>
Hi, The examples of using -flags in the documentation do not seem to work.  Or else the reader of the documenttion does not seem to work.  Either way, what's wrong with the following? Thanks, -Jim Avera #!/usr/bin/perl use strict; use warnings; use Regexp::Common qw/pattern/; # pattern copied and pasted from documentaion of Regexp::Common version 2017060201 pattern name    => [ 'lineof', '-char=_' ],     create  => sub {                    my $flags = shift;                    # gets "use of uninitialized values in quotemeta"                    my $char = quotemeta $flags->{-char};                    return '(?:^$char+$)';                },     match   => sub {                    my ($self, $str) = @_;                    return $str !~ /[^$self->{flags}{-char}]/;                },     subs   => sub {                    my ($self, $str, $replacement) = @_;                    $_[1] =~ s/^$self->{flags}{-char}+$//g;               },     ; $_ = "****"; /$RE{lineof}{-char=>'*'}/ or die "NOT MATCHED";  # dies here
Subject: Re: [rt.cpan.org #129566] AutoReply: Examples in pod do not work(?) Regexp::Common
Date: Mon, 13 May 2019 15:35:34 -0700
To: bug-Regexp-Common [...] rt.cpan.org
From: Jim Avera <jim.avera [...] gmail.com>
Another seeming error in the documentation is that $RE{balanced} regexes contain capturing parenthesis: $ perl -MRegexp::Common -wE "say \$RE{balanced}{-parens=>'()'}" (?^:((?:\((?:(?>[^\(\)]+)|(?-1))*\)))) ...which contradicts the documentation which says "-keep"         By default, the patterns provided by %RE contain no capturing parentheses.