mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 00:22:29 +00:00
Minor changes in splitByRegexp
This commit is contained in:
parent
452dec891d
commit
7c77dd1e21
@ -109,22 +109,22 @@ splitByRegexp(<regexp>, <s>)
|
||||
|
||||
Returns an array of selected substrings. Empty substrings may be selected when:
|
||||
|
||||
Type: [Array](../../sql-reference/data-types/array.md) of [String](../../sql-reference/data-types/string.md).
|
||||
|
||||
- A non-empty regular expression match occurs at the beginning or end of the string;
|
||||
- There are multiple consecutive non-empty regular expression matches;
|
||||
- The original string `s` is empty while the regular expression is not empty.
|
||||
|
||||
Type: [Array](../../sql-reference/data-types/array.md) of [String](../../sql-reference/data-types/string.md).
|
||||
**Example**
|
||||
|
||||
``` sql
|
||||
SELECT splitByRegexp('\\d+', 'a1bc2de3f')
|
||||
SELECT splitByRegexp('\\d+', 'a12bc23de345f')
|
||||
```
|
||||
|
||||
``` text
|
||||
┌─splitByRegexp('\\d+', 'a1bc2de3f')─┐
|
||||
┌─splitByRegexp('\\d+', 'a12bc23de345f')─┐
|
||||
│ ['a','bc','de','f'] │
|
||||
└────────────────────────────────────┘
|
||||
└────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
``` sql
|
||||
@ -196,4 +196,3 @@ Result:
|
||||
│ [['abc','123'],['8','"hkl"']] │
|
||||
└───────────────────────────────────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
select splitByRegexp('\\d+', 'a1ba5ba8b');
|
||||
select splitByRegexp('\\d+', x) from (select arrayJoin(['a1ba5ba8b', 'a11ba5689ba891011b']) x);
|
||||
select splitByRegexp('', 'abcde');
|
||||
select splitByRegexp('<[^<>]*>', x) from (select arrayJoin(['<h1>hello<h2>world</h2></h1>', 'gbye<split>bug']) x);
|
||||
select splitByRegexp('ab', '');
|
||||
|
Loading…
Reference in New Issue
Block a user