V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
invite
V2EX  ›  问与答

浏览器页面搜索的时候,能不能加一个选型,提供正则搜索?

  •  
  •   invite · 2015-03-12 13:13:02 +08:00 · 2130 次点击
    这是一个创建于 3325 天前的主题,其中的信息可能已经有所发展或是发生改变。

    目前有没有浏览器支持? 麻烦推荐一下。

    1 条回复    2015-03-12 14:46:10 +08:00
    saber000
        1
    saber000  
       2015-03-12 14:46:10 +08:00
    用控制台吧,貌似都能支持.

    function rex_find(pattern){
    var regx = new RegExp(pattern, "igm");
    var results = [];
    while ((result = regx.exec(document.body.innerText)) != null){
    results.push(result[0]);
    }
    return results;
    }

    rex_find("\\d+")
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1248 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 23:28 · PVG 07:28 · LAX 16:28 · JFK 19:28
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.