diff --git a/src/Plugin/search_api/processor/Tokenizer.php b/src/Plugin/search_api/processor/Tokenizer.php
index 3b6c0b61..a58d9b28 100644
--- a/src/Plugin/search_api/processor/Tokenizer.php
+++ b/src/Plugin/search_api/processor/Tokenizer.php
@@ -95,8 +95,8 @@ public function validateConfigurationForm(array &$form, FormStateInterface $form
     parent::validateConfigurationForm($form, $form_state);
 
     $spaces = str_replace('/', '\/', trim($form_state->getValues()['spaces']));
-    if ($spaces !== '' && @preg_match('/(' . $spaces . ')+/u', '') === FALSE) {
-      $form_state->setError($form['spaces'], $form['spaces']['#title'] . ': ' . $this->t('The entered text is no valid regular expression.'));
+    if ($spaces !== '' && @preg_match('/[' . $spaces . ']+/u', '') === FALSE) {
+      $form_state->setError($form['spaces'], $form['spaces']['#title'] . ': ' . $this->t('The entered text is no valid PCRE character class.'));
     }
   }
 
diff --git a/tests/src/Functional/ProcessorIntegrationTest.php b/tests/src/Functional/ProcessorIntegrationTest.php
index 94140b6d..1f4f8cd3 100644
--- a/tests/src/Functional/ProcessorIntegrationTest.php
+++ b/tests/src/Functional/ProcessorIntegrationTest.php
@@ -532,9 +532,9 @@ public function checkStopWordsIntegration() {
    */
   public function checkTokenizerIntegration() {
     $configuration = [
-      'spaces' => ':)',
+      'spaces' => '[:foobar:]',
     ];
-    $this->checkValidationError($configuration, 'tokenizer', 'The entered text is no valid regular expression.');
+    $this->checkValidationError($configuration, 'tokenizer', 'The entered text is no valid PCRE character class.');
 
     $configuration = [
       'spaces' => '',
