• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
超萌暖暖
博客园 | 首页 | 新随笔 | 新文章 | 联系 | 订阅 订阅 | 管理

2012年11月19日

RegExp 对象 compile()
摘要: <html><body><script type="text/javascript">var patt1=new RegExp("e");document.write(patt1.test("The best things in life are free"));patt1.compile("d");document.write(patt1.test("The best things in life are free"));</script>< 阅读全文
posted @ 2012-11-19 13:24 lanmo520 阅读(235) 评论(0) 推荐(0)
 
JavaScript RegExp i 修饰符
摘要: <html><body><script type="text/javascript">var str = "Visit W3School";var patt1 = /w3school/i;document.write(str.match(patt1));</script></body></html>结果是 W3Schooli 修饰符用于执行对大小写不敏感的匹配。直接量语法:/regexp/i 阅读全文
posted @ 2012-11-19 13:07 lanmo520 阅读(268) 评论(0) 推荐(0)
 
Regexp
摘要: <html><body><script type="text/javascript">var patt1=new RegExp("e","g");do{result=patt1.exec("The best things in life are free");document.write(result);}while (result!=null) </script></body></html>向 RegExp 对象添加第二个参数,以设定检索。例 阅读全文
posted @ 2012-11-19 12:58 lanmo520 阅读(161) 评论(0) 推荐(0)
 
 

公告


博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3