Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/277.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
Python SQLite全文搜索:在regexp中提取类似组的匹配项_Python_Regex_Sqlite_Full Text Search_Peewee - Fatal编程技术网

Python SQLite全文搜索:在regexp中提取类似组的匹配项

Python SQLite全文搜索:在regexp中提取类似组的匹配项,python,regex,sqlite,full-text-search,peewee,Python,Regex,Sqlite,Full Text Search,Peewee,使用SQLite FTS,您可以找到包含来自查询的文本的表行,并按匹配等级对它们进行排序 但是有没有办法从匹配查询的匹配行中提取文本 对我来说,最接近的类比是regexp组:您不仅可以找到与模式匹配的字符串,还可以使用组(括号)提取精确匹配的字符串部分 我正在使用Peewee ORM,但是非常感谢使用纯SQLite或其他工具的答案。您可以使用来确定搜索文本在文档中的位置。谢谢,这正是我需要的!

使用SQLite FTS,您可以找到包含来自查询的文本的表行,并按匹配等级对它们进行排序

但是有没有办法从匹配查询的匹配行中提取文本

对我来说,最接近的类比是regexp组:您不仅可以找到与模式匹配的字符串,还可以使用组(括号)提取精确匹配的字符串部分


我正在使用Peewee ORM,但是非常感谢使用纯SQLite或其他工具的答案。

您可以使用来确定搜索文本在文档中的位置。

谢谢,这正是我需要的!