Link to home
Start Free TrialLog in
Avatar of skinsfan99
skinsfan99Flag for United States of America

asked on

How to remove leading/trailing spaces, non-breaking spaces and <br/> using Regular expressions and SQL

I am in need of a SQL function that will take a HTML string and returns back a string with  leading/trailing spaces, non-breaking spaces and <br/> removed.    My research indicates that using regular expressions is the way to go.   I am not familar with using regular expressions.

Any help is greatly appreciated.

Thanks,
David
SOLUTION
Avatar of Racim BOUDJAKDJI
Racim BOUDJAKDJI
Flag of Algeria image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of skinsfan99

ASKER

If REPLACE is the way to go then how would I remove leading/trailing spaces, non-breaking spaces and <br/> using it.  Do I still create a SQL function?  This is new to me and I need help with the syntax.

Thanks
by replacing <br/> by ''
Example...
REPLACE (expression, <br/>, '')
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
All of the answers were good but I was hoping for more assistance with the syntax.  This was a whole new concept to me and coding the loop that would go through the HTML and remove the unwanted tags was hanging me up.  The links that PortletPaul supplied was most helpful.

Thanks to all that answered!!