Data update
This commit is contained in:
parent
4d5544505c
commit
4924dd0264
3073 changed files with 55820 additions and 4408 deletions
|
|
@ -0,0 +1,16 @@
|
|||
# `sep` can be a single character or a string but it will be interpreted
|
||||
# as part of a regexp within square brackets, so be careful if characters
|
||||
# such as `-` are used.
|
||||
create or replace function remove_comment(s, sep) as (
|
||||
regexp_replace(s, '\s*[' || sep || '].*', '')
|
||||
);
|
||||
|
||||
# Examples
|
||||
|
||||
select s,
|
||||
remove_comment(s, '#') as decommented,
|
||||
regexp_replace(decommented, ' ', '_','g') as visible
|
||||
from unnest(
|
||||
['apples ; pears # and bananas',
|
||||
'apples # pears ; and bananas']
|
||||
) _s(s);
|
||||
Loading…
Add table
Add a link
Reference in a new issue