Skip to content
Extraits de code Groupes Projets
Valider d6c54601 rédigé par Alexandre Morignot's avatar Alexandre Morignot
Parcourir les fichiers

better regex

parent 7d332a0f
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -43,7 +43,7 @@ sub exec { ...@@ -43,7 +43,7 @@ sub exec {
my ($kernel, $user, $chan, $msg) = @_; my ($kernel, $user, $chan, $msg) = @_;
my ($nick, $mask) = split(/!/,$user); my ($nick, $mask) = split(/!/,$user);
if ($msg =~ /^ *!fav(?: (\S+))?/) { if ($msg =~ /^ *!fav(?: (\S+))? *$/) {
my $index = $1; my $index = $1;
try { try {
my $id = utils::id::get($chan->[0], $index); my $id = utils::id::get($chan->[0], $index);
...@@ -52,7 +52,7 @@ sub exec { ...@@ -52,7 +52,7 @@ sub exec {
$irc->yield(privmsg => $chan->[0] => $insultes[rand @insultes]); $irc->yield(privmsg => $chan->[0] => $insultes[rand @insultes]);
} }
} }
elsif ($msg =~ /^ *!later(?: (-?[0-9]+))?(?: in ([0-9]*)?(h|m|s)?)?/) { elsif ($msg =~ /^ *!later(?: (\S+))?(?: in (\d)+(h|m|s)?)? *$/) {
my $index = $1; my $index = $1;
my ($time, $unit) = ($2, $3); my ($time, $unit) = ($2, $3);
...@@ -63,7 +63,7 @@ sub exec { ...@@ -63,7 +63,7 @@ sub exec {
$irc->yield(privmsg => $chan->[0] => $insultes[rand @insultes]); $irc->yield(privmsg => $chan->[0] => $insultes[rand @insultes]);
}; };
} }
elsif ($msg =~ /^( *!tag)(?:( +)(-?[0-9]+))?/) { elsif ($msg =~ /^( *!tag)(?:( +)(-?\d+))?/) {
my $index = $3; my $index = $3;
my $id; my $id;
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter