Skip to content
Merged
Show file tree
Hide file tree
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
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
Loading