I need help with the following search and replace using regular expressions. I am a beginner as far as regular expressions are considered. I am using javascript to execute these regualr expressions. I have a huge HTML in a variable, I would like to remove some tags from it and in some cases replace the tag with an attribute value from the tag. The HTML content is a multiline text. Source Example 1: <td class="remove borderBottom">test.. <span>sdfslj</span> sdf </td> <td class="borderBottom">sdfsfs</td>
Source Example 2: <input class="replace type="text" textfield" name="junk" value="123" /> <input type="text" class="replace textfield" name="junk2" value="123" /> In example 1 I would like to get all the table cells which has a class remove (including the contents) and replace with spaces. In example 2 I would like get all the input tags with replace class and replace them with value of the "value attribute". I have been working on the first example and could come up with some thing like this. (<td)(.|\n)*(class="remove)(.|\n)*(<\/td>) But it is matching the both the cells instead of getting me the minimum (cell by cell). Thanks in advance, BK ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Create robust enterprise, web RIAs. Upgrade & integrate Adobe Coldfusion MX7 with Flex 2 http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:278300 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

