mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +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:
|
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;
|
- A non-empty regular expression match occurs at the beginning or end of the string;
|
||||||
- There are multiple consecutive non-empty regular expression matches;
|
- There are multiple consecutive non-empty regular expression matches;
|
||||||
- The original string `s` is empty while the regular expression is not empty.
|
- 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**
|
**Example**
|
||||||
|
|
||||||
``` sql
|
``` sql
|
||||||
SELECT splitByRegexp('\\d+', 'a1bc2de3f')
|
SELECT splitByRegexp('\\d+', 'a12bc23de345f')
|
||||||
```
|
```
|
||||||
|
|
||||||
``` text
|
``` text
|
||||||
┌─splitByRegexp('\\d+', 'a1bc2de3f')─┐
|
┌─splitByRegexp('\\d+', 'a12bc23de345f')─┐
|
||||||
│ ['a','bc','de','f'] │
|
│ ['a','bc','de','f'] │
|
||||||
└────────────────────────────────────┘
|
└────────────────────────────────────────┘
|
||||||
```
|
```
|
||||||
|
|
||||||
``` sql
|
``` sql
|
||||||
@ -196,4 +196,3 @@ Result:
|
|||||||
│ [['abc','123'],['8','"hkl"']] │
|
│ [['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('', 'abcde');
|
||||||
select splitByRegexp('<[^<>]*>', x) from (select arrayJoin(['<h1>hello<h2>world</h2></h1>', 'gbye<split>bug']) x);
|
select splitByRegexp('<[^<>]*>', x) from (select arrayJoin(['<h1>hello<h2>world</h2></h1>', 'gbye<split>bug']) x);
|
||||||
select splitByRegexp('ab', '');
|
select splitByRegexp('ab', '');
|
||||||
|
Loading…
Reference in New Issue
Block a user