? seen_re.patch Index: bot_seen/bot_seen.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/bot/bot_seen/Attic/bot_seen.module,v retrieving revision 1.1.2.12.2.7 diff -u -p -r1.1.2.12.2.7 bot_seen.module --- bot_seen/bot_seen.module 6 Feb 2009 17:44:31 -0000 1.1.2.12.2.7 +++ bot_seen/bot_seen.module 12 May 2010 21:35:31 -0000 @@ -111,7 +111,12 @@ function bot_seen_all_nicks_for_regexp() foreach ($irc->channel as $channel_name => $data) { foreach ($irc->channel[$channel_name]->users as $nick_name => $data) { $nick_name = preg_quote($nick_name, '/'); - $nick_name = preg_replace('/^(.)(.*)/', '(\1)(\2)', $nick_name); + + // The \\\\ is a single literal backslash doubly escaped against PCRE + // and PHP. So for readability, think of it as ([^\]|\.) -- any + // character other than a backslash, or a backslash followed by a single + // character. + $nick_name = preg_replace('/^([^\\\\]|\\\\.)(.*)/', '(\1)(\2)', $nick_name); $nicks[] = '/\b' . $nick_name . '\b/i'; } }