Solved

regex replace

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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Suggested Solutions

How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.

730 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