1

我正在尝试构建一个包含空格的全局模式。我试过\\(逃避逃逸,因为它是 java 加空格),[\\ ][[:space:]]. 我不知道如何实现这一点。这看起来简单而愚蠢,但我没有找到任何关于此的文档(sqlite glob 实现)。

我不能使用 LIKE,因为我的表达式的其余部分使用 charranges ([a-d]等)

4

2 回答 2

2

GLOB 文档隐藏在源代码中:

Globbing rules:

     '*'       Matches any sequence of zero or more characters.

     '?'       Matches exactly one character.

    [...]      Matches one character from the enclosed list of
               characters.

    [^...]     Matches one character not in the enclosed list.

With the [...] and [^...] matching, a ']' character can be included
in the list by making it the first character after '[' or '^'.  A
range of characters can be specified using '-'.  Example:
"[a-z]" matches any single lower-case letter.  To match a '-', make
it the last character in the list.

Hints: to match '*' or '?', put them in "[]".  Like this:

        abc[*]xyz        Matches "abc*xyz" only

一个空格可以只匹配模式中的一个空格:

> SELECT ' ' GLOB ' ';
1
于 2013-10-27T19:12:47.237 回答
0

我用过[ ]语法

*[ ]*用空格匹配字符串

于 2013-10-27T12:49:43.453 回答