Solved

regex replace

Posted on 2014-11-06
3
224 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
querying by the sum of a column in decimal 7 56
SQL Query - Oracle 10g - Subract date from next data row 4 48
Error executing command from server 6 41
SQL Query 34 80
Subquery in Oracle: Sub queries are one of advance queries in oracle. Types of advance queries: •      Sub Queries •      Hierarchical Queries •      Set Operators Sub queries are know as the query called from another query or another subquery. It can …
Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
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.
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database

912 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

16 Experts available now in Live!

Get 1:1 Help Now