From 3f9b9f60f1a2a9ae813270d87cbade2f76ed7a47 Mon Sep 17 00:00:00 2001 From: soyeric128 Date: Tue, 1 Apr 2025 22:02:35 -0400 Subject: [PATCH] updates --- .../06-string-functions/glob.md | 40 +++++++++++++++++++ .../06-string-functions/index.md | 3 +- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 docs/en/sql-reference/20-sql-functions/06-string-functions/glob.md diff --git a/docs/en/sql-reference/20-sql-functions/06-string-functions/glob.md b/docs/en/sql-reference/20-sql-functions/06-string-functions/glob.md new file mode 100644 index 0000000000..8d8a70f756 --- /dev/null +++ b/docs/en/sql-reference/20-sql-functions/06-string-functions/glob.md @@ -0,0 +1,40 @@ +--- +title: GLOB +--- + +import FunctionDescription from '@site/src/components/FunctionDescription'; + + + +Performs case-sensitive pattern matching using wildcard characters: + +- `?` matches any single character. +- `*` matches zero or more characters. + +## Syntax + +```sql +GLOB(, ) +``` + +## 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 │ +└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ +``` \ No newline at end of file diff --git a/docs/en/sql-reference/20-sql-functions/06-string-functions/index.md b/docs/en/sql-reference/20-sql-functions/06-string-functions/index.md index cace83f434..14a01f8a90 100644 --- a/docs/en/sql-reference/20-sql-functions/06-string-functions/index.md +++ b/docs/en/sql-reference/20-sql-functions/06-string-functions/index.md @@ -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)