Solved

regex replace

Posted on 2014-11-06
3
221 Views
Last Modified: 2014-11-07
Hi
I'm trying to remove bullet points  from an HTML field using ...............
ltrim(regexp_replace(regexp_replace(regexp_replace(regexp_replace(aa.value,'<li>',''),'</li>','<br>'),'<ul>',''),'</ul>',''))  

However, I'm still getting some whitespace at the beginning of each line in my text field where the next bullet point was - how can I remove this - if possible?

FYI - I am using this field in Crystal Reports where I can see this leading whitespace eg

This was the first bullet point and nicely aligned to the left.
 This was the second bullet point and NOT nicely aligned to the left.
 This was the third bullet point and NOT nicely aligned to the left ..etc
Regards
0
Comment
Question by:PHIL Sawyer
3 Comments
 
LVL 76

Accepted Solution

by:
slightwv (䄆 Netminder) earned 250 total points
ID: 40425980
First:
No need for regexp_replace since you really aren't using any regular expressions.  A simple replace should work.

Now, eliminate crystal reports to figure out where the spaces are.

I typically concatenate a value to both sides and run in sqlplus:
select ':' || some_value || ':' from some_table;

Then I can see if the space is in the value by looking at the colons.  This will tell you if the issue is in the data or in Crystal.
0
 
LVL 73

Assisted Solution

by:sdstuber
sdstuber earned 250 total points
ID: 40426063
if you want to use regexp, you can simply include all of them that have consistent replacement in a " |-list"

trim(replace(regexp_replace(aa.value,'<li>|<br>|<ul>|</ul>'),'</li>','<br>'))


can you post some sample data that is currently erroneous along with expected results?
0
 

Author Closing Comment

by:PHIL Sawyer
ID: 40428197
Thanks
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Article by: Swadhin
From the Oracle SQL Reference (http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/queries006.htm) we are told that a join is a query that combines rows from two or more tables, views, or materialized views. This article provides a glimps…
Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now