Solved

regex replace

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

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.

Question has a verified solution.

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

This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
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.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

861 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