I want to use regexp_replace to replace all blank with '_'.
I use this statment:
select regexp_replace('"<div_class="CCL-temp-border"><div_class="input-group_moveDivEnd"_style="margin-bottom:_5px;_top:_auto;_left:_auto;_width:_100%;_position:_relative;_opacity:_1;_filter:_none;"_data-id="moveDivEnd_1545116285310">_; <span_class="input-group-addon_CCL-te (...)"', '\s', '_', 'g')
But the result is this:
"<div_class="CCL-temp-border"><div_class="input-group_moveDivEnd"_style="margin-bottom:_5px;_top:_auto;_left:_auto;_width:_100%;_position:_relative;_opacity:_1;_filter:_none;"_data-id="moveDivEnd_1545116285310">_;_______<span_class="input-group-addon_CCL-t (...)"
My statment is this:
select case when length(topiccontent)=0 THEN '_' else coalesce(regexp_replace(replace(replace(replace(topiccontent,chr(13), '_'),chr(10),'_'),' ','_'),'\s', '_', 'g'),'_') end as topiccontent from ccl_topics
You can see the blank still exists, why?