Skip to content

docs: glob function #1735

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions docs/en/sql-reference/20-sql-functions/06-string-functions/glob.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
title: GLOB
---

import FunctionDescription from '@site/src/components/FunctionDescription';

<FunctionDescription description="Introduced or updated: v1.2.714"/>

Performs case-sensitive pattern matching using wildcard characters:

- `?` matches any single character.
- `*` matches zero or more characters.

## Syntax

```sql
GLOB(<string>, <pattern>)
```

## Return Type

Returns BOOLEAN: `true` if the input string matches the pattern, `false` otherwise.

## Examples

```sql
SELECT
GLOB('abc', 'a?c'),
GLOB('abc', 'a*d'),
GLOB('abc', 'abc'),
GLOB('abc', 'abcd'),
GLOB('abcdef', 'a?c*'),
GLOB('hello', 'h*l');;

┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ glob('abc', 'a?c') │ glob('abc', 'a*d') │ glob('abc', 'abc') │ glob('abc', 'abcd') │ glob('abcdef', 'a?c*') │ glob('hello', 'h*l') │
├────────────────────┼────────────────────┼────────────────────┼─────────────────────┼────────────────────────┼──────────────────────┤
│ true │ false │ true │ false │ true │ false │
└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
```
Original file line number Diff line number Diff line change
@@ -47,7 +47,7 @@ This section provides reference information for the string-related functions in
- [UCASE](ucase.md)
- [UPPER](upper.md)

## Regular Expressions:
## Pattern Matching:
- [LIKE](like.md)
- [NOT_LIKE](not-like.md)
- [NOT_REGEXP](not-regexp.md)
@@ -58,6 +58,7 @@ This section provides reference information for the string-related functions in
- [REGEXP_REPLACE](regexp-replace.md)
- [REGEXP_SUBSTR](regexp-substr.md)
- [RLIKE](rlike.md)
- [GLOB](glob.md)

## Encoding and Decoding:
- [BIN](bin.md)