Je voudrais adapter un script perl pour irssi qui répondrait automatiquement au mot "bonsoir" ou "bonjour" sur un chan.
Mais je voudrais pas qu'il réponde si on dit "rebonsoir" par exemple : en clair je cherche la regex qui ne prendrait en compte le mot "bonsoir" seulement si il est précédé d'un espace ou si il débute une ligne.
Voilà le bout de code :
sub event_privmsg {
my ($server, $data, $nick) =@_;
my ($target, $text) = $data =~ /^(\S*)\s:(.*)/;
if ($target =~ /^# */i) {
if ( $text =~ /.*bonsoir.*|.*bonjour.*|.*hello.*/i) {
En fait faut surtout que je me penche sur perl pour lui apprendre à compter à ce script : on dit hello il dit hello, on te répond si tu dit hello il redit hello ... c'est sans fin.