diff --git a/twitter.module b/twitter.module
index 9dae9fb..1503e26 100644
--- a/twitter.module
+++ b/twitter.module
@@ -310,17 +310,9 @@ function _twitter_filter_hashtag($text, $filter) {
  * actual links.
  */
 function _twitter_filter_text($text, $prefix, $destination) {
-  $matches = array(
-    '/\>' . $prefix . '(\w+)/ui',
-    '/^' . $prefix . '(\w+)/ui',
-    '/(\s+)' . $prefix . '(\w+)/ui',
-  );
-  $replacements = array(
-    '><a href="' . $destination . '${1}">' . $prefix . '${1}</a>',
-    '<a href="' . $destination . '${1}">' . $prefix . '${1}</a>',
-    '${1}<a href="' . $destination . '${2}">' . $prefix . '${2}</a>',
-  );
-  return preg_replace($matches, $replacements, $text);
+  $match = '/(?<!\w)' . preg_quote($prefix, '/') . '(\w+)/ui';
+  $replacement = '<a href="' . $destination . '$1">' . $prefix . '$1</a>';
+  return preg_replace($match, $replacement, $text);
 }
 
 /**
