mirror of
https://github.com/perlbot/perlbuut
synced 2025-06-08 04:45:41 -04:00
i'm trying to make it more complicated than it needs to be
This commit is contained in:
parent
f40e38f095
commit
3febcdedbc
1 changed files with 2 additions and 10 deletions
|
@ -24,21 +24,13 @@ sub {
|
||||||
my( $said ) = @_;
|
my( $said ) = @_;
|
||||||
|
|
||||||
my $ors =()= $said->{body}=~m/\bor\b/g;
|
my $ors =()= $said->{body}=~m/\bor\b/g;
|
||||||
my $commas =()= $said->{body}=~m/,(?=.*\bor\b)/g;
|
|
||||||
my $common = "";
|
my $common = "";
|
||||||
|
|
||||||
my @a;
|
my @a;
|
||||||
|
|
||||||
if ($ors == 1)
|
if ($ors >= 1)
|
||||||
{
|
|
||||||
if ($commas > 0)
|
|
||||||
{
|
|
||||||
@a = split(/\bor\b/, $said->{body});
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
@a = split(/(?:\bor\b|\s*,\s*)+/, $said->{body});
|
@a = split(/(?:\bor\b|\s*,\s*)+/, $said->{body});
|
||||||
}
|
|
||||||
|
|
||||||
s/^\s*//, s/\s*(\?\s*)?$// for @a; #trim them up
|
s/^\s*//, s/\s*(\?\s*)?$// for @a; #trim them up
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue