Skip Menu |

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

Report information
The Basics
Id: 77651
Status: open
Priority: 0/
Queue: Regexp-Assemble

People
Owner: Nobody in particular
Requestors: x.guimard [...] free.fr
Cc:
AdminCc:

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



Subject: Doesn't handle closing parenthesis in charracter class correctly
Hi, 1 bugs is reported by a Debian user : This code doesn't work properly, but should without problem --->8--- use strict; use Regexp::Assemble; my $ra = Regexp::Assemble->new(); $ra->add('([^)])s-[01]'); print $ra->re; ---8<--- It looks like Regexp::Assemble thinks that ) in [^)] need to be escaped (It doesn't - only ]$^-\ have special mining and may need escaping (but sometimes doesn't need)) but places escape character in wrong position: ---8<--- Building: (?:([^)\])s-[01]|((x)y)) Invalid [] range "s-[" in regex; marked by <-- HERE in m/(?:([^)\])s-[ <-- HERE 01]|((x)y))/ at /usr/share/perl5/Regexp/Assemble.pm line 1004. --->8--- After escaping closing ], character class is still going on, and s-[ is interpreted as character class range, but s-[ is invalid due to the fact that s is AFTER [ in encoding. (Building message is just print STDERR "Building: $str\n"; added to sub _build_re in Regexp/Assemble.pm line 1004., to make debugging easier). http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=675984
Perhaps https://metacpan.org/release/Regexp-Parsertron will help in some way.