在线正则表达式测试工具Regex Tester [Web前端]

post by 朦朧中的罪惡 / 2008-6-8 23:20 Sunday

最近无意中发现一个在线测试正则表达式的网站http://regexpal.com/

它提供所见即所得的正则表达式匹配方式,将你写的正则和匹配的字符串直接高亮标出,非常方便快捷..

 附件[ematt:94]

和emlog 一样 Regex Tester 是开源的,它对于经常要调试正则表达式的程序员来说是开发编程,居家旅行之必备工具...

好东西 收了~!

标签: JavaScript

« php函数serialize()与unserialize()不完全研究 | 思想之地更新至emlog2.7.0预览版»

引用:

评论

  1. 大个子 Says:

    求教正则表达式的问题!

    // 清除WORD冗余格式并粘贴
    function cleanAndPaste( html ) {
        // Remove all SPAN tags
        html = html.replace(/<\/?SPAN[^>]*>/gi, "" );
        // Remove Class attributes
        html = html.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi, "<$1$3") ;
        // Remove Style attributes
        html = html.replace(/<(\w[^>]*) style="([^"]*)"([^>]*)/gi, "<$1$3") ;
        // Remove Lang attributes
        html = html.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3") ;
        // Remove XML elements and declarations
        html = html.replace(/<\\?\?xml[^>]*>/gi, "") ;
        // Remove Tags with XML namespace declarations: <o:p></o:p>
        html = html.replace(/<\/?\w+:[^>]*>/gi, "") ;
        insertHTML( html ) ;
    }

    这个是 eWebEditor 编辑器 中的一个函数,我现在需要改为只替换 html 中的  </SPAN>、<SPAN lang=EN-US>、<SPAN style="mso-spacerun: yes">&nbsp;、
    请问函数怎么写呢
    我的Email:wanggangling_1@sina.com

发表评论