mirror of
https://github.com/pragma-/pbot.git
synced 2025-01-10 20:12:35 +01:00
applets/(c99,c11)std: better handling of capture groups within -text option
This commit is contained in:
parent
0cf80092a7
commit
0023790fec
8
applets/c11std.pl
vendored
8
applets/c11std.pl
vendored
@ -239,8 +239,12 @@ if (length $match_text) {
|
||||
$match_result =~ s/\s+/ /g;
|
||||
|
||||
my $match = eval {
|
||||
$match_result =~ m/(.*)($match_text)(.*)/msi;
|
||||
return [$1, $2, $3];
|
||||
my @matches = ($match_result =~ m/($match_text)/msp);
|
||||
if (@matches > 1) {
|
||||
shift @matches;
|
||||
@matches = grep { length $_ } @matches;
|
||||
}
|
||||
return [${^PREMATCH}, join (' ... ', @matches), ${^POSTMATCH}];
|
||||
};
|
||||
|
||||
if ($@) {
|
||||
|
8
applets/c99std.pl
vendored
8
applets/c99std.pl
vendored
@ -239,8 +239,12 @@ if (length $match_text) {
|
||||
$match_result =~ s/\s+/ /g;
|
||||
|
||||
my $match = eval {
|
||||
$match_result =~ m/(.*)($match_text)(.*)/msi;
|
||||
return [$1, $2, $3];
|
||||
my @matches = ($match_result =~ m/($match_text)/msp);
|
||||
if (@matches > 1) {
|
||||
shift @matches;
|
||||
@matches = grep { length $_ } @matches;
|
||||
}
|
||||
return [${^PREMATCH}, join (' ... ', @matches), ${^POSTMATCH}];
|
||||
};
|
||||
|
||||
if ($@) {
|
||||
|
@ -25,8 +25,8 @@ use PBot::Imports;
|
||||
# These are set by the /misc/update_version script
|
||||
use constant {
|
||||
BUILD_NAME => "PBot",
|
||||
BUILD_REVISION => 4549,
|
||||
BUILD_DATE => "2022-07-03",
|
||||
BUILD_REVISION => 4550,
|
||||
BUILD_DATE => "2022-07-04",
|
||||
};
|
||||
|
||||
sub initialize {}
|
||||
|
Loading…
Reference in New Issue
Block a user