Subject: | $RE{comment}{Pascal} fails to match "(*****)" as a valid comment. |
$RE{comment}{Pascal} does not match "(*****)" as a valid comment. This
is incorrect; it is valid.
It seems that $RE{comment}{Pascal} needs to see a character other than
"*" somewhere in the comment. That is, "(** **)" is correctly recognised
as a comment.
I attach a small test script to demonstrate the problem.
FYI: I used the following re instead: /([(][*]|[{]).*?([}]|[*][)])/. I'm
not sure that this does all that one in the module does, but it's
sufficient for my purposes.
My perl -v info is:
This is perl, v5.8.7 built for MSWin32-x86-multi-thread
(with 14 registered patches, see perl -V for more detail)
Copyright 1987-2005, Larry Wall
Binary build 815 [211909] provided by ActiveState http://www.ActiveState.com
ActiveState is a division of Sophos.
Built Nov 2 2005 08:44:52
Subject: | pascal_comment_test.pl |
use strict;
use warnings;
use Regexp::Common;
testit("(*****)",
" (*****) ",
"(* This is a comment *)",
" (* This is a comment *) ",
"(*** **)",
" (*** **) ",
"(* *)");
sub testit {
for my $text (@_) {
print "Testing: $text\n";
if ($text =~ /$RE{comment}{Pascal}/) {
print " Comment\n";
}
else {
print " Not comment\n";
}
}
}