-
Notifications
You must be signed in to change notification settings - Fork 601
Closed
Description
Description
According to documentation: https://perldoc.perl.org/perlrequick#Matching-repetitions
a{n,m} = match at least n times, but not more than m times.
a{n,} = match at least n or more times
a{,n} = match n times or fewer
a{n} = match exactly n times
But when I tried to use a{,n} syntax, then I got the error above.
Steps to Reproduce
$ perl -e 'm/a{1,2}/'
$ perl -e 'm/a{1,}/'
$ perl -e 'm/a{,2}/'
Unescaped left brace in regex is illegal here in regex; marked by <-- HERE in m/a{ <-- HERE ,2}/ at -e line 1.
$ perl -e 'm/a{2}/'This issue occurs on 5.22.1, 5.28.1, 5.30.3, 5.32.0
5.34.0 and 5.37.6 Ok.
Probably this error belongs to: https://perldoc.perl.org/5.26.0/perldelta#Unescaped-literal-%22%7B%22-characters-in-regular-expression-patterns-are-no-longer-permissible
But if so, should we change documentation for perlrequick and possible other places.
Expected behavior
No error.
Perl configuration
Summary of my perl5 (revision 5 version 30 subversion 3) configuration:
Platform:
osname=linux
osvers=5.4.0-37-generic
archname=x86_64-linux
uname='linux work 5.4.0-37-generic #41~18.04.1-ubuntu smp mon jun 8 13:37:29 utc 2020 x86_64 x86_64 x86_64 gnulinux '
config_args='-de -Dprefix=/home/kes/perl5/perlbrew/perls/perl-5.30.3 -Aeval:scriptdir=/home/kes/perl5/perlbrew/perls/perl-5.30.3/bin'
hint=recommended
useposix=true
d_sigaction=define
useithreads=undef
usemultiplicity=undef
use64bitint=define
use64bitall=define
uselongdouble=undef
usemymalloc=n
default_inc_excludes_dot=define
bincompat5005=undef
Compiler:
cc='cc'
ccflags ='-fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
optimize='-O2'
cppflags='-fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include'
ccversion=''
gccversion='7.5.0'
gccosandvers=''
intsize=4
longsize=8
ptrsize=8
doublesize=8
byteorder=12345678
doublekind=3
d_longlong=define
longlongsize=8
d_longdbl=define
longdblsize=16
longdblkind=3
ivtype='long'
ivsize=8
nvtype='double'
nvsize=8
Off_t='off_t'
lseeksize=8
alignbytes=8
prototype=define
Linker and Libraries:
ld='cc'
ldflags =' -fstack-protector-strong -L/usr/local/lib'
libpth=/usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/7/include-fixed /usr/include/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib /lib64 /usr/lib64
libs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
libc=libc-2.27.so
so=so
useshrplib=false
libperl=libperl.a
gnulibc_version='2.27'
Dynamic Linking:
dlsrc=dl_dlopen.xs
dlext=so
d_dlsymun=undef
ccdlflags='-Wl,-E'
cccdlflags='-fPIC'
lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector-strong'
Characteristics of this binary (from libperl):
Compile-time options:
HAS_TIMES
PERLIO_LAYERS
PERL_COPY_ON_WRITE
PERL_DONT_CREATE_GVSV
PERL_MALLOC_WRAP
PERL_OP_PARENT
PERL_PRESERVE_IVUV
USE_64_BIT_ALL
USE_64_BIT_INT
USE_LARGE_FILES
USE_LOCALE
USE_LOCALE_COLLATE
USE_LOCALE_CTYPE
USE_LOCALE_NUMERIC
USE_LOCALE_TIME
USE_PERLIO
USE_PERL_ATOF
Locally applied patches:
Devel::PatchPerl 1.38
Built under linux
Compiled at Jun 22 2020 14:54:09
%ENV:
PERLBREW="command perlbrew"
PERLBREW_HOME="/home/kes/.perlbrew"
PERLBREW_MANPATH="/home/kes/perl5/perlbrew/perls/perl-5.30.3/man"
PERLBREW_PATH="/home/kes/perl5/perlbrew/bin:/home/kes/perl5/perlbrew/perls/perl-5.30.3/bin"
PERLBREW_PERL="perl-5.30.3"
PERLBREW_ROOT="/home/kes/perl5/perlbrew"
PERLBREW_SHELLRC_VERSION="0.89"
PERLBREW_VERSION="0.89"
@INC:
/home/kes/perl5/perlbrew/perls/perl-5.30.3/lib/site_perl/5.30.3/x86_64-linux
/home/kes/perl5/perlbrew/perls/perl-5.30.3/lib/site_perl/5.30.3
/home/kes/perl5/perlbrew/perls/perl-5.30.3/lib/5.30.3/x86_64-linux
/home/kes/perl5/perlbrew/perls/perl-5.30.3/lib/5.30.3
Metadata
Metadata
Assignees
Labels
No labels