mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-23 10:10:50 +00:00
87b2d90725
Function that extracts from haystack all matching non-overlapping groups with regular expressions, and put those into Array(Array(String)) column. Example: :) SELECT extractAllGroups('abc=111, def=222, "jkl mno"="444 foo bar"', '("[^"]+"|\\w+)=("[^"]+"|\\w+)'); ┌─extractAllGroups('abc=111, def=222, "jkl mno"="444 foo bar"', '("[^"]+"|\\w+)=("[^"]+"|\\w+)')─┐ │ [['abc','def','"jkl mno"'],['111','222','"444 foo bar"']] │ └────────────────────────────────────────────────────────────────────────────────────────────────┘
24 lines
470 B
Plaintext
24 lines
470 B
Plaintext
0 groups, zero matches
|
|
[]
|
|
1 group, multiple matches, String and FixedString
|
|
[['hello','world']]
|
|
[['hello','world']]
|
|
[['hello','world']]
|
|
[['hello','world']]
|
|
[['hello','world']]
|
|
[['hello','world']]
|
|
mutiple groups, multiple matches
|
|
[['abc','def','ghi','"jkl mno"'],['111','222','333','"444 foo bar"']]
|
|
big match
|
|
0 1 0 []
|
|
260 1 1 [156]
|
|
520 1 3 [156,156,156]
|
|
lots of matches
|
|
0 1 0 0
|
|
260 1 260 260
|
|
520 1 520 520
|
|
lots of groups
|
|
0 100 0 []
|
|
260 100 2 [1,1]
|
|
520 100 5 [1,1,1,1,1]
|