From 47b4fb71337b08935dd2418dfd7438939059232c Mon Sep 17 00:00:00 2001 From: erdgeist <> Date: Wed, 27 Jul 2005 16:39:45 +0000 Subject: Some regex issues --- bot.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bot.pl b/bot.pl index 3c68caf..d426602 100644 --- a/bot.pl +++ b/bot.pl @@ -7,8 +7,8 @@ use DBI; use POE; use POE::Component::IRC; -my $current_nick = 'francoise_'; -my $channel = '#test'; +my $current_nick = 'francoise'; +my $channel = '#kiffer.de'; POE::Component::IRC->new("francoise"); POE::Session->new ( _start => \&irc_start, @@ -177,7 +177,7 @@ sub irc_pub_msg{ $sth->execute( $word, $is0r, $isact ); } - if ( $msg =~ /^wo ist (\S+)\??$/i ) { + if ( $msg =~ /^wo ist (\S+?)\??$/i ) { my $wois_ = $1; my $wois = francoise_getbasenick( $1 ); my $sth = $dbh->prepare( "SELECT awaymsg FROM users WHERE nick = ? AND isaway = 'true'"); @@ -187,7 +187,7 @@ sub irc_pub_msg{ } else { $kernel->post( 'francoise', 'privmsg', $channel, "Ich weiss nicht, wo $wois_ ist." ); } - } elsif( $msg =~ /(?:\S: )(.+?) ($hv) (.*)$/i ) { + } elsif( $msg =~ /^(?:\S+: )?(.+?)\s+($hv)\s+(.*)$/i ) { my $trigger = $1; my $hilfsverb = $2; my $reply = $3; -- cgit v1.2.3