diff --git a/includes/processor_html_filter.inc b/includes/processor_html_filter.inc
index 180c9c1..929850a 100644
--- a/includes/processor_html_filter.inc
+++ b/includes/processor_html_filter.inc
@@ -120,7 +120,7 @@ class SearchApiHtmlFilter extends SearchApiAbstractProcessor {
         );
       }
       $text = substr($text, $pos + 1);
-      if (!preg_match('#^(/?)([-:_a-zA-Z]+)#', $text, $m)) {
+      if (!preg_match('#^(/?)([:_a-zA-Z][-:_a-zA-Z0-9.]*)#', $text, $m)) {
         continue;
       }
       $text = substr($text, strpos($text, '>') + 1);
diff --git a/search_api.test b/search_api.test
index 8988302..23f36bc 100644
--- a/search_api.test
+++ b/search_api.test
@@ -1062,7 +1062,7 @@ class SearchApiUnitTest extends DrupalWebTestCase {
   protected function checkHtmlFilter() {
     $orig = <<<END
 This is <em lang="en" title =
-"something">a test</em>.
+"something">a test</em>.<h3>Header</h3>
 How to write <strong>links to <em>other sites</em></strong>: &lt;a href="URL" title="MOUSEOVER TEXT"&gt;TEXT&lt;/a&gt;.
 &lt; signs can be <A HREF="http://example.com/topic/html-escapes" TITLE =  'HTML &quot;escapes&quot;'
 TARGET = '_blank'>escaped</A> with "&amp;lt;".
@@ -1071,6 +1071,7 @@ END;
     $tags = <<<END
 em = 1.5
 strong = 2
+h3 = 3
 END;
     $processed1 = array(
       array('value' => 'This', 'score' => 1),
@@ -1078,6 +1079,7 @@ END;
       array('value' => 'something', 'score' => 1.5),
       array('value' => 'a', 'score' => 1.5),
       array('value' => 'test', 'score' => 1.5),
+      array('value' => 'Header', 'score' => 3),
       array('value' => 'How', 'score' => 1),
       array('value' => 'to', 'score' => 1),
       array('value' => 'write', 'score' => 1),
