Solved

regex replace

Posted on 2014-11-06
3
236 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 77

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 74

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
Shell script to create broker configuration file using current broker Configuration, solely for purpose of backup on Linux. Script may need to be modified depending on OS-installation. Please deploy and verify the script in a test environment.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to take different types of Oracle backups using RMAN.

688 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