Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/74.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-apps-script/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql 匹配单词,但单词中可能包含空格_Sql_Regex_Whitespace - Fatal编程技术网

Sql 匹配单词,但单词中可能包含空格

Sql 匹配单词,但单词中可能包含空格,sql,regex,whitespace,Sql,Regex,Whitespace,有没有办法将regexp(或SQL)中的单词与空格匹配,例如 此将与 this T hi s 这是 您可以尝试这样的表达式(t\s*h\s*i\s*s\s*) 您需要确保设置不区分大小写。我想这是在word中的每个字符之间手动添加\s*的唯一方法。您可以在每个字母后使用\s*,这意味着0个或更多的空格。但是您可以使用replace()使用一个简单的解决方案 @Lion regexp或SQL(MySQL应该支持regexp)您使用什么作为单词分隔符?@DavidChan还包括空格:(数据来自数千

有没有办法将regexp(或SQL)中的单词与空格匹配,例如

将与

  • this
  • T hi s
  • 这是

您可以尝试这样的表达式
(t\s*h\s*i\s*s\s*)


您需要确保设置不区分大小写。

我想这是在word中的每个字符之间手动添加
\s*
的唯一方法。

您可以在每个字母后使用
\s*
,这意味着0个或更多的空格。但是您可以使用replace()使用一个简单的解决方案


@Lion regexp或SQL(MySQL应该支持regexp)您使用什么作为单词分隔符?@DavidChan还包括空格:(数据来自数千个扫描页面,因此对此无需采取任何措施。这比在每个单词后添加
\s*
要好得多,但如果单词多于“this”,例如“this is a s e n ten c e”,则有点难以理解这将如何工作。)
WordThis.replace(' ','').equals("this")