日期:2014-05-17  浏览次数:21084 次

正则表达式,去除嵌套div问题
源html代码如下:
<div id="promo">
    <div id="deletediv">
        <div style="height: 30px; width: 100px;" class="uploadify" id="file_upload1">
            <object style="position: absolute; z-index: 1;" id="SWFUpload_0" type="application/x-shockwave-flash"
                data="js/jquery.uploadify/uploadify.swf?preventswfcaching=1361958323822" class="swfupload"
                height="30" width="100">
                <param name="wmode" value="transparent">
                <param name="movie" value="js/jquery.uploadify/uploadify.swf?preventswfcaching=1361958323822">
                <param name="quality" value="high">
                <param name="menu" value="false">
                <param name="allowScriptAccess" value="always">
                <param name="flashvars" value="movieName=SWFUpload_0&amp;uploadURL=%2FLcms%2FHTMLTemplate%2FTemplate1%2F..%2F..%2FFiles%2FFileUpload.ashx&amp;useQueryString=false&amp;requeueOnError=false&amp;httpSuccess=&amp;assumeSuccessTimeout=30&amp;params=upload%3Dfile%26amp%3Bfilecode%3D88888&amp;filePostName=Filedata&amp;fileTypes=*.jpg&amp;fileTypesDescription=select%20file&amp;fileSizeLimit=4MB&amp;fileUploadLimit=0&amp;fileQueueLimit=1&amp;debugEnabled=false&amp;buttonImageURL=%2FLcms%2FHTMLTemplate%2FTemplate1%2F&amp;buttonWidth=100&amp;buttonHeight=30&amp;buttonText=&amp;buttonTextTopPadding=0&amp;buttonTextLeftPadding=0&amp;buttonTextStyle=color%3A%20%23000000%3B%20font-size%3A%2016pt%3B&amp;buttonAction=-100&amp;buttonDisabled=false&amp;buttonCursor=-2">
            </object>
            <div style="height: 30px; line-height: 30px; width: 100px;" class="uploadify-button uploadbutton"
                id="file_upload1-button">
                <span class="uploadify-button-text">图片</span></div>
        </div>
        <div class="uploadify-queue" id="file_upload1-queue">
        </div>
    </div>
    <img id="img1custmor" src="" style="display: none;">
</div>

使用正则,把<div id="deletediv">包含的内容全部替换掉,怎么做?

谢谢
正则表达式 div

------解决方案-------------------