Wrox Programmer Forums
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old September 5th, 2006, 06:52 AM
Friend of Wrox
Join Date: Oct 2003
Posts: 290
Thanks: 24
Thanked 0 Times in 0 Posts


I need to change a simple string using regular expression + javascript but I am stuck with the regular expression.

This is the string:

<DIV class="action" style="WIDTH: 80px" onclick="sortFullGrid(1, 13, 'Total Ads')">Total Ads
</DIV> </NOBR> </TD> <TD align="middle">

I need to get rid of carriage return and blank spaces between the tags. the output:

<DIV class="action" style="WIDTH: 80px" onclick="sortFullGrid(1, 13, 'Total Ads')">Total Ads</DIV></NOBR></TD><TD align="middle"><NOBR>

To get rid of the carriage return I used this:

However, I cannot get rid of the blank spaces. I have tried this ' ', '' but it will also remove white space from inside the tags (<DIVclass="...)and this is not what I need.

I have tried this as well: > < but it does not work.

Can someone shed some light?


Similar Threads
Thread Thread Starter Forum Replies Last Post
Regular Expression Help Please rstelma ASP.NET 1.0 and 1.1 Professional 0 January 2nd, 2008 07:01 PM
regular expression if-then smay Javascript 4 July 5th, 2005 12:10 PM
Regular Expression Help Greg Griffiths Javascript How-To 4 November 12th, 2004 05:33 AM
Regular Expression DARSIN General .NET 2 November 9th, 2004 08:30 AM
Regular Expression Help Hadware .NET Web Services 3 November 4th, 2003 10:51 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.