diff --git a/core/lib/Drupal/Core/Database/Driver/mysql/Select.php b/core/lib/Drupal/Core/Database/Driver/mysql/Select.php
index aecae55..92e94eb 100644
--- a/core/lib/Drupal/Core/Database/Driver/mysql/Select.php
+++ b/core/lib/Drupal/Core/Database/Driver/mysql/Select.php
@@ -9,4 +9,13 @@
 
 use Drupal\Core\Database\Query\Select as QuerySelect;
 
-class Select extends QuerySelect { }
+class Select extends QuerySelect {
+
+  /**
+   * Implements \Drupal\Core\Database\Query\SelectInterface::getRegexOperator().
+   */
+  public function getRegexOperator() {
+    return "RLIKE";
+  }
+
+}
diff --git a/core/lib/Drupal/Core/Database/Driver/pgsql/Select.php b/core/lib/Drupal/Core/Database/Driver/pgsql/Select.php
index c2a5a05..4e52f20 100644
--- a/core/lib/Drupal/Core/Database/Driver/pgsql/Select.php
+++ b/core/lib/Drupal/Core/Database/Driver/pgsql/Select.php
@@ -104,6 +104,14 @@ public function orderBy($field, $direction = 'ASC') {
     $this->addField(NULL, $field);
     return $return;
   }
+
+  /**
+   * Implements \Drupal\Core\Database\Query\SelectInterface::getRegexOperator().
+   */
+  public function getRegexOperator() {
+    return "~*";
+  }
+
 }
 
 /**
diff --git a/core/lib/Drupal/Core/Database/Driver/sqlite/Select.php b/core/lib/Drupal/Core/Database/Driver/sqlite/Select.php
index 5403611..8808d78 100644
--- a/core/lib/Drupal/Core/Database/Driver/sqlite/Select.php
+++ b/core/lib/Drupal/Core/Database/Driver/sqlite/Select.php
@@ -14,4 +14,12 @@ public function forUpdate($set = TRUE) {
     // SQLite does not support FOR UPDATE so nothing to do.
     return $this;
   }
-}
\ No newline at end of file
+
+  /**
+   * Implements \Drupal\Core\Database\Query\SelectInterface::getRegexOperator().
+   */
+  public function getRegexOperator() {
+    return "REGEXP";
+  }
+
+}
diff --git a/core/lib/Drupal/Core/Database/Query/Select.php b/core/lib/Drupal/Core/Database/Query/Select.php
index 1bfe9a0..fb2dc9a 100644
--- a/core/lib/Drupal/Core/Database/Query/Select.php
+++ b/core/lib/Drupal/Core/Database/Query/Select.php
@@ -14,7 +14,7 @@
 /**
  * Query builder for SELECT statements.
  */
-class Select extends Query implements SelectInterface {
+abstract class Select extends Query implements SelectInterface {
 
   /**
    * The fields to SELECT.
diff --git a/core/lib/Drupal/Core/Database/Query/SelectExtender.php b/core/lib/Drupal/Core/Database/Query/SelectExtender.php
index 2f27d1b..90a000d 100644
--- a/core/lib/Drupal/Core/Database/Query/SelectExtender.php
+++ b/core/lib/Drupal/Core/Database/Query/SelectExtender.php
@@ -327,4 +327,12 @@ public function __call($method, $args) {
       return $return;
     }
   }
+
+  /**
+   * Implements \Drupal\Core\Database\Query\SelectInterface::getRegexOperator().
+   */
+  public function getRegexOperator() {
+    return $this->query->getRegexOperator();
+  }
+
 }
diff --git a/core/lib/Drupal/Core/Database/Query/SelectInterface.php b/core/lib/Drupal/Core/Database/Query/SelectInterface.php
index 779e69d..eecf7ef 100644
--- a/core/lib/Drupal/Core/Database/Query/SelectInterface.php
+++ b/core/lib/Drupal/Core/Database/Query/SelectInterface.php
@@ -380,6 +380,14 @@ public function orderBy($field, $direction = 'ASC');
   public function orderRandom();
 
   /**
+   * Get query operator for regular expressions.
+   *
+   * @return string
+   *   The operator used by a specific database implementation.
+   */
+  public function getRegexOperator();
+
+  /**
    * Restricts a query to a given range in the result set.
    *
    * If this method is called with no parameters, will remove any range
diff --git a/core/modules/system/lib/Drupal/system/Tests/Database/SelectTest.php b/core/modules/system/lib/Drupal/system/Tests/Database/SelectTest.php
index 85787b8..efefc14 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Database/SelectTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Database/SelectTest.php
@@ -368,6 +368,39 @@ function testRandomOrder() {
   }
 
   /**
+   * Tests that filter by a regular expression works as expected.
+   */
+  public function testRegexCondition() {
+    $test_groups[] = array(
+      'regex' => 'hn$',
+      'expected' => array(
+        'John',
+      ),
+    );
+    $test_groups[] = array(
+      'regex' => '^Pau',
+      'expected' => array(
+        'Paul',
+      ),
+    );
+    $test_groups[] = array(
+      'regex' => 'Ringo|George',
+      'expected' => array(
+        'Ringo', 'George',
+      ),
+    );
+    foreach ($test_groups as $test_group) {
+      $query = db_select('test', 't');
+      $query->addField('t', 'name');
+      $query->condition('t.name', $test_group['regex'], $query->getRegexOperator());
+      $result = $query->execute()->fetchCol();
+
+      $this->assertEqual(count($result), count($test_group['expected']), 'returns the expected number of rows.');
+      $this->assertEqual(sort($result), sort($test_group['expected']), 'Returns the expected rows.');
+    }
+  }
+
+  /**
    * Tests that aliases are renamed when they are duplicates.
    */
   function testSelectDuplicateAlias() {
diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/filter/String.php b/core/modules/views/lib/Drupal/views/Plugin/views/filter/String.php
index be3e132..7278ba9 100644
--- a/core/modules/views/lib/Drupal/views/Plugin/views/filter/String.php
+++ b/core/modules/views/lib/Drupal/views/Plugin/views/filter/String.php
@@ -112,6 +112,12 @@ function operators() {
         'method' => 'op_longer',
         'values' => 1,
       ),
+      'regular_expression' => array(
+        'title' => t('Regular expression'),
+        'short' => t('regex'),
+        'method' => 'op_regex',
+        'values' => 1,
+      ),
     );
     // if the definition allows for the empty operator, add it.
     if (!empty($this->definition['allow empty'])) {
@@ -130,17 +136,6 @@ function operators() {
         ),
       );
     }
-    // Add regexp support for MySQL.
-    if (Database::getConnection()->databaseType() == 'mysql') {
-      $operators += array(
-        'regular_expression' => array(
-          'title' => t('Regular expression'),
-          'short' => t('regex'),
-          'method' => 'op_regex',
-          'values' => 1,
-        ),
-      );
-    }
 
     return $operators;
   }
@@ -333,8 +328,18 @@ function op_longer($field) {
     $this->query->add_where_expression($this->options['group'], "LENGTH($field) > $placeholder", array($placeholder => $this->value));
   }
 
-  function op_regex($field) {
-    $this->query->add_where($this->options['group'], $field, $this->value, 'RLIKE');
+  /**
+   * Filters by a regular expression.
+   *
+   * @param string $field
+   *   The expression pointing to the queries field, for example "foo.bar".
+   */
+  public function op_regex($field) {
+    // There is no database select object available when constructing the view
+    // query, so create one, to get the regular expression.
+    $select_class = Database::getConnection()->select($this->view->storage('base_table'));
+    $operator = $select_class->getRegexOperator();
+    $this->query->add_where($this->options['group'], $field, $this->value, $operator);
   }
 
   function op_empty($field) {
