SQLite 3 reference · String Functions
SQLite GLOB Operator
Match a string against a Unix-style pattern with *, ? and [...]. Unlike LIKE, GLOB is case-sensitive.
SQLite 3
Syntax
X GLOB pattern | glob(pattern, X)
Parameters
| Parameter | Description |
|---|---|
X |
The string to test. |
pattern |
* any characters, ? one character, [a-z] a set. |
Return value
1 (true) or 0 (false).
Examples
SELECT name
FROM products
WHERE name GLOB '[A-D]*';
Output
name Clean Code Coffee Mug Desk Lamp
SELECT 'Desk' GLOB 'd*' AS lowercase_pattern, 'Desk' LIKE 'd%' AS with_like;
Output
lowercase_pattern | with_like 0 | 1
Related
LIKE· Match a string against a pattern with % (any run of characters) and _ (one character). Case-insensitive for ASCII.- SQL LIKE and Wildcards · tutorial