我想像这样使用 sqlite3 查询:
select * from Log where Desc glob '*[ _.,:;!?-(){}[]<>''"]OK';
查找以 OK 结尾的记录,例如
OK
asdasda _OK
asda (OK
dasda [OK
dasda ]OK
但是当我在查询 ...glob '*[ []]OK';
中使用后括号时,这让我失败了
有什么建议吗?
最佳答案
隐藏在源代码中的注释说:
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.
因此,您的记录可以通过 ... glob '*[] _.,:;!?(){}[<>''"-]OK'
找到.
关于sqlite - 如何在sqlite中使用glob并查找大括号?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12934671/