diff --git wp-includes/compat.php wp-includes/compat.php
index cb2a559..9d01933 100644
--- wp-includes/compat.php
+++ wp-includes/compat.php
@@ -94,3 +94,15 @@ if ( !function_exists('json_decode') ) {
 		return is_array($data) ? array_map(__FUNCTION__, $data) : $data;
 	}
 }
+
+if ( !function_exists( 'str_getcsv' ) ) {
+	function str_getcsv( $input, $delimiter = ',', $enclosure = '"', $escape = "\\" ) {
+		$fp = fopen( 'php://temp/', 'r+' );
+		fputs( $fp, $input );
+		rewind( $fp );
+		$data = fgetcsv( $fp, strlen( $input ), $delimiter, $enclosure );
+		fclose( $fp );
+		return $data;
+	}
+}
+
diff --git wp-includes/functions.php wp-includes/functions.php
index 726eebb..dbc0d1f 100644
--- wp-includes/functions.php
+++ wp-includes/functions.php
@@ -3399,19 +3399,6 @@ function get_file_data( $file, $default_headers, $context = '' ) {
 }
 
 /**
- * Used internally to tidy up the search terms.
- *
- * @access private
- * @since 2.9.0
- *
- * @param string $t
- * @return string
- */
-function _search_terms_tidy($t) {
-	return trim($t, "\"'\n\r ");
-}
-
-/**
  * Returns true.
  *
  * Useful for returning true to filters easily.
diff --git wp-includes/query.php wp-includes/query.php
index 303a395..78ba230 100644
--- wp-includes/query.php
+++ wp-includes/query.php
@@ -2180,8 +2180,7 @@ class WP_Query {
 			if ( !empty($q['sentence']) ) {
 				$q['search_terms'] = array($q['s']);
 			} else {
-				preg_match_all('/".*?("|$)|((?<=[\r\n\t ",+])|^)[^\r\n\t ",+]+/', $q['s'], $matches);
-				$q['search_terms'] = array_map('_search_terms_tidy', $matches[0]);
+				$q['search_terms'] = array_filter( str_getcsv( $q['s'], ' ' ) );
 			}
 			$n = !empty($q['exact']) ? '' : '%';
 			$searchand = '';
