The below query working for one string. However when I run at whole table data it's not working
select
lower( regexp_replace( nvl(column1,':'), '\\s+|[][!"#$%&\'()*+,.\\\\/:;<=>?@\^_`{|}~-]+', '')) as addres_line_1,
column1
from values('122 E 7th Street ');
output: 122e7thstreet
when I run similar query for the table, the white spaces are not fully removed.
output: 122e7th street
table level query:
select concat(
column1, ':',
column2, ':',
lower(regexp_replace(regexp_replace(nvl(ADDRESS_LINE_1,':'),'\\s|[][!"#$%&\'()*+,.\\\\/:;<=>?@\^_`{|}~-]+',''),'[ \t\r\n\v\f]+','')), ':',
lower(regexp_replace(nvl(ADDRESS_LINE_2,':'),'\\s|[][!"#$%&\'()*+,.\\\\/:;<=>?@\^_`{|}~-]+','')), ':',
lower(regexp_replace(nvl(ADDRESS_LINE_3,':'),'\\s|[][!"#$%&\'()*+,.\\\\/:;<=>?@\^_`{|}~-]+','')), ':',
lower(regexp_replace(nvl(PRIMARY_TOWN,':'),'\\s|[][!"#$%&\'()*+,.\\\\/:;<=>?@\^_`{|}~-]+','')), ':',
lower(regexp_replace(nvl(COUNTRY,':'),'\\s|[][!"#$%&\'()*+,.\\\\/:;<=>?@\^_`{|}~-]+','')), ':',
lower(regexp_replace(nvl(TERRITORY_CODE,':'),'\\s|[][!"#$%&\'()*+,.\\\\/:;<=>?@\^_`{|}~-]+','')), ':',
lower(regexp_replace(nvl(POSTAL_CODE,':'),'\\s|[][!"#$%&\'()*+,.\\\\/:;<=>?@\^_`{|}~-]+|\\s+','')), ':',
lower(regexp_replace(nvl(COUNTRY_CODE,':'),'\\s|[][!"#$%&\'()*+,.\\\\/:;<=>?@\^_`{|}~-]+',''))
) as ROLE_PLAYER_ADDRESS_HASH_KEY1
from address