diff --git a/autocomplete.inc b/autocomplete.inc
index 07851ad..42a6e19 100644
--- a/autocomplete.inc
+++ b/autocomplete.inc
@@ -16,7 +16,7 @@ function _webform_defaults_autocomplete() {
   $defaults['extra'] += array(
     'autocomplete_items' => '',
     'autocomplete_existing' => 0,
-    'autocomplete_match_rule' => 1,
+    'autocomplete_match_rule' => WEBFORM_AUTOCOMPLETE_MATCH_CONTAINS,
     'autocomplete_restrict' => 0,
     'autocomplete_result_count' => 20,
   );
@@ -111,9 +111,9 @@ function _webform_edit_autocomplete($component) {
     '#type' => 'select',
     '#title' => t('Match Rule'),
     '#options' => array(
-      0 => t('starts with'),
-      1 => t('contains'),
-      2 => t('ends with'),
+      WEBFORM_AUTOCOMPLETE_MATCH_BEGIN => t('starts with'),
+      WEBFORM_AUTOCOMPLETE_MATCH_CONTAINS => t('contains'),
+      WEBFORM_AUTOCOMPLETE_MATCH_END => t('ends with'),
     ),
     '#parents' => array('extra', 'autocomplete_match_rule'),
     '#default_value' => $component['extra']['autocomplete_match_rule'],
@@ -257,12 +257,12 @@ function webform_autocomplete_js($node, $cid, $str = '') {
       $options = preg_split('/\r\n|\r|\n/', $component['extra']['autocomplete_items']);
       foreach ($options as $val) {
         $is_match = FALSE;
-        if ($match_rule == 0) {
+        if ($match_rule == WEBFORM_AUTOCOMPLETE_MATCH_BEGIN) {
           if (strpos($val, $str, 0) === 0) {
             $is_match = TRUE;
           }
         }
-        elseif ($match_rule == 1) {
+        elseif ($match_rule == WEBFORM_AUTOCOMPLETE_MATCH_CONTAINS) {
           if (stripos($val, $str) !== FALSE) {
             $is_match = TRUE;
           }
@@ -286,10 +286,10 @@ function webform_autocomplete_js($node, $cid, $str = '') {
     // Only fire the query if we have fewer than $result_count results already
     if (!empty($component['extra']['autocomplete_existing']) && $count < $result_count) {
       $str_like = db_like($str);
-      if ($match_rule == 1 || $match_rule == 2) {
+      if ($match_rule == WEBFORM_AUTOCOMPLETE_MATCH_CONTAINS || $match_rule == WEBFORM_AUTOCOMPLETE_MATCH_END) {
         $str_like = '%' . $str_like;
       }
-      if ($match_rule == 0 || $match_rule == 1) {
+      if ($match_rule == WEBFORM_AUTOCOMPLETE_MATCH_BEGIN || $match_rule == WEBFORM_AUTOCOMPLETE_MATCH_CONTAINS) {
         $str_like = $str_like . '%';
       }
 
diff --git a/webform_autocomplete.module b/webform_autocomplete.module
index a93fa1e..808dc9f 100644
--- a/webform_autocomplete.module
+++ b/webform_autocomplete.module
@@ -6,6 +6,10 @@
  * @author Coleman Watts
  */
 
+define('WEBFORM_AUTOCOMPLETE_MATCH_BEGIN', 0);
+define('WEBFORM_AUTOCOMPLETE_MATCH_CONTAINS', 1);
+define('WEBFORM_AUTOCOMPLETE_MATCH_END', 2);
+
 /**
  * Implements hook_menu().
  *
