extractAllGroups(haystack, re_needle) function
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"']] │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
2020-04-24 08:37:11 +00:00
|
|
|
0 groups, zero matches
|
|
|
|
1 group, multiple matches, String and FixedString
|
2020-06-09 09:47:59 +00:00
|
|
|
[['hello','world']]
|
|
|
|
[['hello','world']]
|
|
|
|
[['hello','world']]
|
|
|
|
[['hello','world']]
|
|
|
|
[['hello','world']]
|
|
|
|
[['hello','world']]
|
extractAllGroups(haystack, re_needle) function
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"']] │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
2020-04-24 08:37:11 +00:00
|
|
|
mutiple groups, multiple matches
|
2020-06-09 09:47:59 +00:00
|
|
|
[['abc','def','ghi','"jkl mno"'],['111','222','333','"444 foo bar"']]
|
extractAllGroups(haystack, re_needle) function
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"']] │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
2020-04-24 08:37:11 +00:00
|
|
|
big match
|
2020-06-09 09:47:59 +00:00
|
|
|
0 1 0 []
|
extractAllGroups(haystack, re_needle) function
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"']] │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
2020-04-24 08:37:11 +00:00
|
|
|
260 1 1 [156]
|
|
|
|
520 1 3 [156,156,156]
|
|
|
|
lots of matches
|
2020-06-09 09:47:59 +00:00
|
|
|
0 1 0 0
|
extractAllGroups(haystack, re_needle) function
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"']] │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
2020-04-24 08:37:11 +00:00
|
|
|
260 1 260 260
|
|
|
|
520 1 520 520
|
|
|
|
lots of groups
|
2020-06-09 09:47:59 +00:00
|
|
|
0 100 0 []
|
extractAllGroups(haystack, re_needle) function
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"']] │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
2020-04-24 08:37:11 +00:00
|
|
|
260 100 2 [1,1]
|
|
|
|
520 100 5 [1,1,1,1,1]
|